Bird
0
0

You are designing a DDD model for an online store. Which of the following best represents an Aggregate?

hard📝 Trade-off Q15 of 15
LLD - Advanced LLD Concepts
You are designing a DDD model for an online store. Which of the following best represents an Aggregate?
AAn Order object that contains multiple OrderItems and enforces business rules
BA single Product object with price and description
CA database table storing customer addresses
DA utility service that calculates discounts
Step-by-Step Solution
Solution:
  1. Step 1: Understand Aggregate in DDD

    An Aggregate is a cluster of related objects treated as a single unit with a root entity controlling consistency.
  2. Step 2: Match options with Aggregate concept

    An Order object that contains multiple OrderItems and enforces business rules describes an Order with multiple OrderItems and business rules, fitting Aggregate definition.
  3. Final Answer:

    An Order object containing multiple OrderItems and enforcing business rules -> Option A
  4. Quick Check:

    Aggregate = root entity + related objects [OK]
Quick Trick: Aggregate = root entity plus related objects as one unit [OK]
Common Mistakes:
  • Confusing single entities with aggregates
  • Thinking utility services are aggregates
  • Mixing database tables with domain aggregates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes