18 Domain Events

WHAT’S IN THIS CHAPTER?

  • An introduction to the domain events design pattern
  • An explanation of domain events’ core concepts
  • Multiple domain events’ implementation patterns
  • Testing applications that use domain events

Wrox.com Code Downloads for This Chapter

The wrox.com code downloads for this chapter are found at www.wrox.com/go/domaindrivendesign on the Download Code tab. The code is in the Chapter 18 download and individually named according to the names throughout the chapter.

Domain-Driven Design (DDD) practitioners have found that they can better understand the problem domain by learning about the events that occur within it—not just the entities. These events, known as domain events, will be uncovered during knowledge-crunching sessions with domain experts. Uncovering domain events is so valuable that DDD practitioners have innovated knowledge-crunching techniques to make them more event-focused using practices such as event storming (http://ziobrando.blogspot.co.uk/2013/11/introducing-event-storming.html#.U5YPynU-mHs). With these innovations, though, come new challenges. Now that conceptual models are event-centric, the code also needs to be event-centric so it can express the conceptual model. This is where the domain events design pattern adds value.

Part II focused on events that are sent as asynchronous messages between bounded contexts using transports like a message bus or REST. However, the domain events design pattern is generally used as a ...

Get Patterns, Principles, and Practices of Domain-Driven Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.