Entity Block
An entity is a domain object that has identity over time.
When To Use It
Use an Entity block for something inside an aggregate that must be tracked as the same thing over time. An order line, shipment stop, appointment attendee, or claim evidence item can be an entity when its identity matters.
Required Data
- Name: domain noun.
- Parent aggregate: aggregate that owns the entity.
- Identity: how this entity is distinguished from others.
- Attributes: descriptive fields needed by rules or events.
- Lifecycle: created, updated, removed, activated, completed, or cancelled states if relevant.
Recommended Data
- Rules: invariants involving this entity.
- Events affected: domain events that include this entity’s facts.
- Visibility: whether it appears in read models or stays internal to the aggregate.
Entity Or Value Object?
If identity matters, use an entity. If only the values matter, use a value object. A specific shipment stop with a scan history may be an entity. A delivery address may be a value object unless the business tracks that address record as its own thing.