T
- aggregate root typepublic interface AggregateDomainEvent<T extends AggregateRoot> extends Identifiable
Domain event
which should be used when there is an action
to be applied on a single aggregate root
.
When domain event
affects only a single aggregate, then we can use
specialized aggregate domain event. This event can't have side effects outside
aggregate, which allows it to be replayed when it's asynchronous.
This is useful in write intensive scenarios to minimize write load in the database,
but will increase read load, because reading aggregate will have to read all its
unapplied events and apply them during reconstruction.
AggregateDomainEvent is defined in DSL with keyword event
.
module Todo { aggregate Task; event<Task> MarkDone; }
getURI