문제

Versioning
If your events changes you would create a new version of that event, and keep the old ones. To keep your domain code form being bloated with handling of all versions of events you would basically introduce a component that converts your events from previous to newer versions, and then apply them on the domain. Remember that events are things that actually happened in your domain so in most cases the information in deprecated events are valuable.

I still haven't found any example of this.

Any help?

도움이 되었습니까?

해결책

십진법 버전은 오류에 대한 더 나은 설명을 제공합니다.

Python 2.7.2+ (default, Feb 16 2012, 18:47:58) 
>>> import decimal
>>> s = '45.2091000080109'
>>> decimal.getcontext().prec = 5
>>> decimal.Decimal(s).quantize(decimal.Decimal('.00001'), rounding=decimal.ROUND_UP)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/decimal.py", line 2464, in quantize
    'quantize result has too many digits for current context')
  File "/usr/lib/python2.7/decimal.py", line 3866, in _raise_error
    raise error(explanation)
decimal.InvalidOperation: quantize result has too many digits for current context
>>> 
.

문서 :

다른 작업과 달리 계수의 길이가 양자화 작업은 정확도보다 커질 것입니다. 무효화가 신호됩니다.이는 AN이 아닌 한, 오류 상태, 양자화 된 지수는 항상 오른쪽 피연산자.

그러나 나는 이것이 무엇을 의미하는지 모르겠다는 것을 고백해야합니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top