Managing Transactions

The domain model and its encompassing Domain Layer is never the correct place to manage transactions.5 The operations associated with a model are usually too fine grained to themselves manage transactions and shouldn’t be aware that transactions play a part in their life cycle. If you are to avoid placing transactional concerns in the model, just where do they belong?

5. Note that for some persistence mechanisms transaction management is either nonexistent or works differently from ACID transactions common with relational databases. Both Coherence and many NoSQL stores differ in that way, and this material is generally not applicable to such data storage mechanisms.

A common architectural approach to facilitating transactions ...

Get Implementing Domain-Driven Design now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.