AbstractProtectedconstructorStatic ReadonlyeventStable name used for subscription and dispatch. Namespaced by bounded
context — "library.CopyCheckedOut", not "CopyCheckedOut".
Static, because it identifies the kind of event, and both sides of
the system need it without holding an instance: @Handle(CopyCheckedOut)
registers under it at class-definition time, and dispatch looks up under
the name of an event it has in hand. Those two must be the same string.
declare means the base class emits no JavaScript for it — subclasses
provide the value. TypeScript has no abstract static, so a subclass that
forgets it cannot be caught at compile time; the getter below and
Handle both fail loudly instead.
ReadonlyoccurredReadonlysequenceGlobal ordering stamp — see the note on sequenceCounter above.
The instance's event name, derived from its class. Not settable, and not
something a subclass should redeclare as a field — declare
static readonly eventName instead, so registration and dispatch agree.
Something that has already happened in the domain, expressed in the ubiquitous language.
Three rules follow from that one sentence:
CopyCheckedOut, neverCheckOutCopy. A command can be refused; an event cannot — it is a historical fact.BookStockobject inside it would smuggle a mutable, already-stale reference across a consistency boundary.