Slide 5
Slide 5 text
DOMAIN EVENTS
Events happen in the past. For example, "the speaker was booked," "the seat was reserved," "the
cash was dispensed." Notice how we describe these events using the past tense.
Events are immutable. Because events happen in the past, they cannot be changed or undone.
However, subsequent events may alter or negate the effects of earlier events. For example, "the
reservation was cancelled" is an event that changes the result of an earlier reservation event.
Events are one-way messages. Events have a single source (publisher) that publishes the event. One
or more recipients (subscribers) may receive events.
Typically, events include parameters that provide additional information about the event. For
example, "Seat E23 was booked by Alice."
In the context of event sourcing, events should describe business intent. For example, "Seat E23
was booked by Alice" describes in business terms what has happened and is more descriptive than,
"In the bookings table, the row with key E23 had the name field updated with the value Alice."