👨‍💻
Software Engineering
Implementing Domain Driven Design
Implementing Domain Driven Design
  • Intro
  • 1. Getting Started with DDD
    • The Business Value of DDD
  • 4: Architecture
  • 5: Entities
    • Why We Use Entities
    • Unique Identity
  • 6: Value Objects
    • Value Object Characteristics
    • Integrate with Minimalism
    • Standard Types Expressed as Values
    • Resources
  • 10: Aggregates
  • 8: Domain Events
    • The When & Why of Domain Events
    • Modeling Events
    • Publishing Events from the Domain Model
  • 13: Factories
  • Resources
Powered by GitBook
On this page
  • How do we determine when something that happens is important?
  • Other situations requiring events
  • Eventual Consistency
  • Does Every Aggregate Command result in an Event?
  1. 8: Domain Events

The When & Why of Domain Events

How do we determine when something that happens is important?

  • When Domain Experts talk, listen for:

    • "When..."

    • "If that happens..."

    • "Inform me if..."

    • "Notify me if..."

    • "An occurrence of..."

Other situations requiring events

  • There will be times when the spoken language of domain experts doesn't lead to a clear reason to model an Event, yet the business situation may still call for it.

  • Tends to happen when Events must be broadcast to external services, where the systems in your enterprise have been decoupled and occurrences throughout the domain must be communicated across Bounded Contexts.

Eventual Consistency

  • When Events are delivered to interested parties (local or foreign), they are generally used to facilitate eventual consistency.

  • Used to synchronize other Aggregate instances in the local Bounded context.

  • We also bring Remote dependencies into a consistent state with latency.

    • This decoupling helps provide highly scalable & peak-performing set of cooperative services.

    • Also helps us achieve loose coupling between systems.

Does Every Aggregate Command result in an Event?

  • Not always

  • Knowing when to disregard extraneous happenings in the domain that experts don't care about is just as important.

Previous8: Domain EventsNextModeling Events

Last updated 1 year ago