domain driven design - Transaction involves several aggregate roots -
how can deal transactions involve several aggregate roots? imaginane have domain service perfom bank transaction between 2 accounts.
aggregateroot1 = repository.getbyid(id1); aggregateroot2 = repository.getbyid(id2); aggregateroot1.increaseamount(sum); //first transaction aggregateroot2.decreaseamount(sum); //second transaction
how can handle case when electricity fails after first transaction or this? new in ddd (ddd + cqrs+ eventsourcing) , looking benefits , weak sides of such design approach. thanks.
thats interesting question reveals 2 interesting things ddd + cqrs + eventsourcing.
the first, @ face value way manage process process manager can track success or otherwise of process , hence knows when , how persist result. manager can ensure manages 'transaction' , can ensure passes or fails.
the sec part methods themselves. key benefit of cqrs , of import driver using ddd end 'ubiquitous language' system. increaseamount doesn't 'why' amount beingness increased. transfer between accounts owned same person or payment beingness made or charge beingness levied.... recap, key strength of ddd , 1 happens default in cqrs end language , non-techy business people domain knowledge can understand , reason about. powerful , of import benefit of ddd in general , cqrs specifically.
not sure if answered question hope if gives nutrient thought.
transactions domain-driven-design
No comments:
Post a Comment