Aggregates, value objects and enums
The model inside a bounded context: aggregates with their properties, invariants, domain events, entities and methods; value objects; enums.
Aggregates
An aggregate is a consistency boundary: what must be true together after every change. It belongs to one bounded context and holds:
Value objects
A value object is a value without identity, such as Money or Address. It has properties, invariants and methods, but no domain events or entities.
Enums
An enum lists named cases with a description each, such as PaymentMethod with the cases card, invoice and voucher.
Types
A property, input or return type is one of:
- a primitive:
text,number,bool,dateorid; - a reference to another artefact: an aggregate, value object, enum, data contract or read model;
- a collection of those:
list,setormap.
Any type may be nullable. A reference is stored by id, so renames never break it.
Lists and order
Properties, invariants, events, entities, methods, cases, steps and outcomes keep the order you give them; drag to reorder. Archiving a member, such as a property or a case, keeps it in the history.