Domain Event
|
Term |
Domain Event |
|
Aliases |
- |
Definition
A Domain Event represents an observation that carries meaning within the domain and triggers corresponding behaviors or processes.
Domain events explicitly model state changes in the system or business and drive interactions across application layers or with external systems.
Remarks
-
Phenomenon is an observable phenomenon, Observation is its record, and Domain Event is the occurrence with domain-specific meaning.
-
Domain events are named based on the ubiquitous language and serve as key elements in the domain model.
-
Events are typically expressed using past-tense verb phrases (e.g., OrderPlaced, PaymentCompleted).
EXAMPLES
| Name | 説明 |
|---|---|
|
OrderPlaced |
An order was placed |
|
PaymentCompleted |
A payment was completed |
|
UserRegistered |
A user was registered |
|
ShipmentDelivered |
A shipment was delivered |
SimpleModeling
-
In SimpleModeling, domain events are usually treated as immutable value objects, but they are also managed as entities in event stores or for historical tracking.
-
As entities, domain events carry identifiers, timestamps, and source associations (entities or components), enabling replay and auditing.