Aggregates

In DDD, the concept of an aggregate is a boundary that helps in decomposing larger modules into smaller clusters of domain objects, and so the technical complexities can be managed as a high level of abstraction. Aggregates help in doing the following:

  • Reducing and constraining relationships between domain objects
  • Grouping objects of the same business use cases and viewing them as a unified model

Every aggregate has a specific root and border, and within that particular border, all the possible invariants should be satisfied. Domain invariants are statements or rules that always need to be adhered to and help preserve consistency (also known as atomic transactional coherence).

The preceding diagram represents an aggregator sample implementation and brief information about each class and its characteristics associated with aggregates context as follows:

  • CreditReport: This includes user information and links, and saves and stores external linkage by Customer ID (identifier).
  • CustomerID: This an independent aggregate that preserves user information
  • CreditScore: This holds credit rating estimation rule and act as invariants. This invariant gets modified/impacted based on credit modifications history.
  • CreditHistoryEntry: This helps achieve transactional coherence when it's modified.
  • Inquiry: This can handle specific credit score requests from third-party organizations.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset