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.
Last updated