Skip to main content
OBJECT-ORIENTED-PROGRAMMING5 MIN READ

Find the aggregate boundary

Choose aggregate boundaries by identifying consistency rules and external references.

The pressure Checkout loads a whole object graph and locks rows that do not need to change together. A smaller aggregate can protect the real invariant without turning every related object into one transaction. DDD tactical design Aggregate = consistency boundary Put objects inside the aggregate only when the root must enforce an immediate invariant across them. Shortcut Model every relationship as containment The transaction protects the rule without locking unrelated lifecycles. The aggregate root controls internal consistency; outsiders do not reach into children. 01 Invariant 02 Root 03 Outside Step 1 The command is addLine(productId, quantity). The total must…

Read the full lesson

Sign up free — one personalized lesson every day, matched to your role and goals.

Already have an account? Sign in

← Back to library
Contact us