Aggregates
An Aggregate is a cluster of domain objects that are treated as a single unit with regards to data changes.
The aggregate ensures that all the changes to the objects within the aggregate are performed in a consistent and transactional manner.
Key characteristics of an Aggregate are:
Consistency Boundary: The aggregate defines a clear boundary for transactional consistency. All invariants and business rules within an aggregate must be satisfied as a whole, ensuring that the domain remains in a valid state at all times.
Encapsulation: The internal structure and state of the aggregate's objects are hidden from the outside world. External entities can only interact with the aggregate through its root.
Lifecycle: Aggregates are typically long-lived, persisting over multiple transactions. They should be designed with consideration for their lifecycle management.
Isolation: Aggregates should not directly reference or hold references to other aggregates. Instead, they can reference other aggregates by their unique identifiers (IDs).
Last updated