Software → Software Design
Aggregate Root
The designated entity that controls access to an aggregate and protects its invariants.
Motivation
An Aggregate Root provides one controlled entry point for changing an aggregate.
Responsibilities
- Enforce aggregate invariants.
- Coordinate changes among contained objects.
- Expose stable identifiers and operations.
- Prevent external code from bypassing consistency rules.
Common mistakes
- Treating the root as a passive data object.
- Allowing repositories for every internal entity.
- Referencing internal objects directly from other aggregates.