Publishing your Domain Events from Domain or Application Services

You should struggle to publish Domain Events from deeper in the chain. The closer to the inside of the Entity or the Value Object, the better. As we saw in the previous section, sometimes this isn't easy, but the final result is simpler for the clients. We've seen developers publishing Domain Events from the Application Services or Domain Services. This looks easier to do, but it will eventually lead to an Anemic Domain Model. This is not unlike when pushing business logic in Domain Services instead of placing it into your Entities.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset