DomainEvent
Represents a domain event published by an aggregate in response to a command.
Domain events capture significant business occurrences that have happened within an aggregate. They are immutable facts about past actions and serve as the primary mechanism for communicating state changes to other parts of the system.
Domain events follow declarative design principles (idempotent, similar to Kubernetes apply or Docker image layers). During event sourcing, aggregates should simply apply domain events as overlay layers without complex logic or conditional checks, eliminating the need for explicit sourcing functions.
Key characteristics:
Immutable: Events represent facts that cannot be changed
Named: Each event has a specific business meaning
Versioned: Events carry version information for compatibility
Sequenced: Events maintain order within an aggregate's lifecycle
Author
ahoo wang
Type Parameters
The type of the event body payload
See also
for base messaging capabilities
for aggregate identification
for versioning information