Aggregate root
An aggregate root is the designated domain object through which an aggregate’s members and consistency rules are accessed and modified.
Spring in Action, Sixth Edition
The designated domain object that serves as the entry point for access to the objects within an aggregate.
- How it is used
- Organizes taco-order persistence around TacoOrder as the entry point for its Taco objects.
- How deep it goes
- Explains the boundary through JDBC save steps and MongoDB mapping, while identifying R2DBC repository behavior that needs a service-level workaround.
- Examples
- Uses a TacoOrder containing tacos, separate Ingredient objects, an OrderRepository interface, and a MongoDB document class.
- What you can do after
- Build it from scratch: define a JDBC repository that saves an order with its tacos and ingredient references.
Read how Spring in Action, Sixth Edition explains aggregate root →
Simple Object-Oriented Design: Create clean, maintainable applications
An aggregate root is the designated domain object through which an aggregate's members and consistency rules are accessed and modified.
- How it is used
- Uses aggregate roots to control updates to complex object graphs and keep domain invariants consistent.
- How deep it goes
- Defines access and repository rules, then works through enrollment and cancellation updates while deferring deeper aggregate design.
- Examples
- Uses Basket with Items and Products, then Offering with Enrollment, available spots, enrollment, and cancellation.
- What you can do after
- Apply it by routing aggregate changes and persistence through a root while evaluating when smaller aggregates or eventual consistency fit.
Collaborative Software Design: How to facilitate domain modeling decisions
An aggregate root is the designated domain object through which modifications to an aggregate are managed.
- How it is used
- Uses aggregate roots to preserve business invariants while translating collaborative models into executable code.
- How deep it goes
- Explains consistency boundaries, transactions, invariants, and a simplified implementation, while stopping short of a complete production design.
- Examples
- Demonstrates ScheduledMovieSeating for seat allocation and ScheduledMovie for ticket capacity and request-size constraints.
- What you can do after
- Apply it by grouping related domain objects and routing invariant-sensitive modifications through one aggregate root.
Related concepts
- domain-driven designused by · Domain-driven design is a software design approach that centers models, structure, and terminology on the concepts, behavior, and boundaries of a problem domain.
- Spring Data R2DBCcontrasts with · Spring Data R2DBC is a Spring Data project that provides repository-based persistence for relational databases through the Reactive Relational Database Connectivity API.
- invariantaddresses · An invariant is a property or condition that remains true across the valid states, operations, or specified transformations of a system or computation.
- consistencyaddresses · Consistency is the property of related data, behavior, outputs, or states agreeing with one another or conforming to defined rules across relevant instances or operations.
- subdocumenthas part · A subdocument is a document nested within another document and stored as part of the containing document.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


