Leave transaction control to the client. Although the REPOSITORY will insert into and delete from the database, it will ordinarily not commit anything. It is tempting to commit after saving, for example, but the client presumably has the context to correctly initiate and commit units of work. Transaction management will be simpler if the REPOSITORY keeps its hands off.
- Six. The Life Cycle of a Domain Object
- from Domain-Driven Design: Tackling Complexity in the Heart of Software
- Publisher: Addison-Wesley Professional
- Released: August 2003
For OnBalance, that means that ISession management is not the responsibility of the Repository class.
Share this highlighthttp://learning.oreilly.com/a/domain-driven-design-tackling/17891604/