domain driven design - Example of a AggregateRoot and single responsibility principle -


i doing bit of research ddd, cqrs , es. looking @ source code of aggregate root, curious whether not violate single responsibility principle? or expected aggregate root/ddd? feedback appreciated. lot.

another way think of srp "there must single reason code change". if there more 1 reason can it's srp violation.

so looking @ code can see few reasons might change:

additional account information required stored, more account name. customer services need information contact account holder, address, email, phone number.

the memento object deserialization needs become more complex. @ moment it's single pipe | separating amount , account:

 var split = ledger.value.split(new[] { '|' }); 

there's number of events, accountopenedevent accountclosedevent etc. class change if there more events required in future, e.g. accountsuspendedevent.

i go on, yes class violates srp in opinion. need changed now? no, not, hope there decent test suite (this here) , refactor later first step before implementing change.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -