In Domain-Driven Design (DDD), an Aggregate is a cluster of domain objects that are treated as a single unit. An aggregate contains one or more entities, with one designated as the Aggregate Root. The aggregate root is the only permitted entry point for modifying any of the entities within the aggregate boundary, ensuring consistency by enforcing business rules across the entire aggregate.
Key points about an aggregate:
Example:
In an e-commerce system, an Order aggregate might include the order entity, line items, and shipping details, with the Order being the aggregate root. All modifications or queries related to the order are performed through the aggregate root.