public interface DomainEvent extends Identifiable
They are the preferred way of manipulating data instead of simple CUD
operations (create, update, delete).
Unlike the aggregate domain event which is tied
to a change in a single aggregate root, domain event
should be used when an action will result in modifications to multiple
aggregates, an external call (like sending an email) or some other action.
By default, events 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;
}
}
getURI