Class DomainEvent
Domain event represents an meaningful business event that occurred in the
system. It is a message that back-end system knows how to process and that will
change the state of the system.
They are preferred way of manipulating data instead of simple CRUD operations
(create, update, delete). Unlike NGS\Patterns\AggregateDomainEvent
which is tied to a
change in a single NGS\Patterns\AggregateRoot
, DomainEvent should be used when an
action will result in modifications to multiple aggregates, external call (like
sending an email) or some other action.
By default event will be applied immediately. If async is used, event will be stored immediately but applied later.
DomainEvent is defined in DSL with keyword event.
module Todo { aggregate Task; event MarkDone { Task task; } }
public
string
|