O'Reilly logo

Implementing Domain-Driven Design by Vaughn Vernon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Publisher

Perhaps the most common use of Domain Events is when an Aggregate creates an Event and publishes it. The publisher resides in a Module (9) of the model, but it doesn’t model some aspect of the domain. Rather, it provides a simple service to Aggregates that need to notify subscribers of Events. The following is a DomainEventPublisher, which adheres to this definition. An abstract view of how the DomainEventPublisher is used can be found in Figure 8.2.

package com.saasovation.agilepm.domain.model; import java.util.ArrayList; import java.util.List; public class DomainEventPublisher {     @SuppressWarnings("unchecked")     private static final ThreadLocal<List> subscribers =             new ThreadLocal<List>(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required