DDD - Domain Events

[#vaughn-ddddis], on 6th chapter:

Domain events happen after something happened in your 202105192148 DDD - Bounded Contexts. They broadcast that something happen, so all contexts that listen to this event can act accordingly.

Best practices for event domains:

  • Add a timestamp (specially because the subscribers might not receive them synchronously)
  • Use 202105192149 DDD - Ubiquitous Language
  • When naming, use the past tense
  • Have enough data so everyone can act on it, but be careful not to be excessive

If it is important to reconstruct state by order of events, one should consider 202106091345 DDD - Event Sourcing

[#vaughn-ddddis]: Vernon, Vaughn. Domain-Driven Design Distilled. Boston: Addison-Wesley, 2016.