liveBook · Manning

Aggregate root

As explained in 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.

An aggregate root is the domain object through which modifications to an aggregate are managed. Group domain objects within one consistency boundary when their business invariants must hold during a single transaction. section 12.3.2

Allocating one seat per ticket

To prevent one seat from being allocated to multiple tickets, encapsulate Seat, Row, and ScheduledMovieSeating in an aggregate and manage changes through ScheduledMovieSeating. A ScheduledMovie aggregate similarly enforces limits such as available capacity and no more than eight requested tickets. section 12.3.2

How Collaborative Software Design: How to facilitate domain modeling decisions covers it

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 it assumes
Assumes domain objects, business invariants, transactions, and EventStorm modeling; establishes aggregates through a concrete seating scenario.
What you can do after
Apply it by grouping related domain objects and routing invariant-sensitive modifications through one aggregate root.
How it connects
Connects aggregates with domain objects, business invariants, transactions, EventStorm, consistency boundaries, and bounded contexts.

Also explained in

Compare how 3 books explain aggregate root →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Collaborative Software Design: How to facilitate domain modeling decisions. The section links point to the parts of the book it draws on.