Software → Software Design
Aggregate
A consistency boundary that groups domain objects and is modified through a single aggregate root.
Motivation
An Aggregate defines which domain objects must remain consistent together during a business operation.
Mental model
Treat an aggregate as one transactional unit. External code references and modifies it through its aggregate root.
Common mistakes
- Making aggregates so large that every change becomes one transaction.
- Exposing internal entities directly.
- Using aggregates only as persistence containers.