0

As I get it, domain events imply loose coupling and separation of responsibilities. That's fine. But if domain events are allowed to cross aggregate's boundaries then it is a question how to guarantee that all concerned entities are materialized from persistence storage? For now it looks like events can only bubble through aggregate to the root or be handled by services triggering in-transaction scripts. In the letter case I believe the targeting specifics of the event is lost.

Again and again My questions arise from the fact that the whole model does not live in the memory.

1 Answer 1

5

Normally the component that listens for domain events is an adapter ('adapter' as in the "ports & adapters" architecture design) or perhaps a domain service. This components are usually stateless and are instantiated in the start of the application.

In the book Implementing DDD by Vaughn Vernon there is one chapter dedicated to domains events. I cannot reproduce here because its a complex concept, but the book has code examples (in java) and will probably solve a lot of your doubts about Domain Events.

I recommend reading Vernon's whole book if you are really interested in DDD; IMHO its the best book on the subject, with realistic examples and real approaches to implement the ideas in the original Eric Evans Book.

1
  • Purchased it several days ago. Scheduled for reading soon:) Jul 24, 2014 at 4:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.