liveBook · Manning

Aggregate

A domain-driven design aggregate is a cluster of related domain objects treated as a unit for consistency and state changes, typically accessed through a designated root.

How 4 Manning books explain it

Collaborative Software Design: How to facilitate domain modeling decisions

A consistency boundary is a boundary within which related state must satisfy business invariants as a single consistent unit.

How it is used
Uses aggregates to turn collaborative modeling constraints into implementable boundaries that preserve business invariants.
How deep it goes
Explains boundaries, transactions, aggregate roots, and invariant enforcement, then stops short of a complete implementation.
Examples
Uses seat allocation, scheduled movies, tickets, rows, and a simplified ScheduledMovie aggregate to illustrate invariant enforcement.
What you can do after
Builds aggregate boundaries and methods from modeled constraints while keeping related domain objects internally consistent.

Read how Collaborative Software Design: How to facilitate domain modeling decisions explains aggregate →

Simple Object-Oriented Design: Create clean, maintainable applications

An aggregate is a cluster of related domain objects treated as a consistency boundary and accessed through a designated root.

How it is used
Defines a consistency boundary for clusters of domain objects and their persistence.
How deep it goes
Explains root-only access, repository boundaries, and a worked Offering–Enrollment design; defers deeper aggregate-root design.
Examples
Uses Basket–Item–Product and Offering–Enrollment relationships, including enrollment cancellation and available spots.
What you can do after
Apply it by routing related changes and persistence through an aggregate root while evaluating exceptions pragmatically.

Read how Simple Object-Oriented Design: Create clean, maintainable applications explains aggregate →

Spring in Action, Sixth Edition

An aggregate is a domain-driven design cluster of related objects treated as a unit for consistency and lifecycle management.

How it is used
Organizes domain objects and directs repository operations around an aggregate root.
How deep it goes
Defines membership and demonstrates multi-table saving, but defers broader domain-driven design beyond aggregates and roots.
Examples
Uses TacoOrder, Taco, Ingredient, IngredientRef, SQL tables, and a JdbcOrderRepository save operation.
What you can do after
Build it from scratch by defining an aggregate root, repository, schema relationships, and coordinated JDBC persistence.

Read how Spring in Action, Sixth Edition explains aggregate →

Grokking Software Architecture

An aggregate is a group of related data treated as a single unit for storage and operations.

How it is used
Frames aggregates as a NoSQL data-modeling approach for grouping related data into a unit retrieved together.
How deep it goes
Defines aggregates and explains read and update tradeoffs through a customer example, without exploring implementation internals.
Examples
Uses a customer document bundling profile, addresses, and recent orders to illustrate aggregation.
What you can do after
Evaluate read-performance gains against the difficulty of updating specific data across multiple aggregates.

Read how Grokking Software Architecture explains aggregate →

Also covered in

What to know first

Related concepts

Questions about aggregate

What is aggregate?

A domain-driven design aggregate is a cluster of related domain objects treated as a unit for consistency and state changes, typically accessed through a designated root.

Which Manning books explain aggregate?

Collaborative Software Design: How to facilitate domain modeling decisions, Simple Object-Oriented Design: Create clean, maintainable applications, Spring in Action, Sixth Edition and Grokking Software Architecture.

What should I know before learning aggregate?

Manning books that teach aggregate usually introduce domain-driven design, command, entity and enum first.

What is the difference between aggregate and enum?

A domain-driven design aggregate is a cluster of related domain objects treated as a unit for consistency and state changes, typically accessed through a designated root. An enum is a type whose values are selected from a finite set of named alternatives.

What is aggregate part of?

Aggregate is part of domain-driven design. Domain-driven design is a software design approach that centers models, structure, and terminology on the concepts, behavior, and boundaries of a problem domain.

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.