An “Aggregate Root” is a concept of Domain Driven Design that describes the main entity (“root”) of a graph of nested objects.
Classic example: a
Customer entity might be associated with multiple
Orders in a shop system, and an
Order references many
In terms of the Bounded Context of “making an order”, the
Ordercan be the aggregate root: a
LineItems, which are
Productreferences + their quantities + bulk discounts. The
PendingOrdergroups, or: “aggregates”, all these info.
In terms of the Bounded Context of “listing all previous orders”, the
Customerobject is the Aggregate Root with all its associated
Orders and maybe even
PendingOrders that await payment or represent a shopping basket.