A cluster of associated objects that are treated as a unit for the purpose of data changes. External references are restricted to one member of the Aggregate, designated as the root. A set of consistency rules applies within the Aggregate's boundaries.
Questions tagged [aggregateroot]
441 questions
0
votes
2 answers
How to load an aggregate?
In the articles/books on ddd in the chapters that treat aggregates I have the feeling that a subject is never discussed :
How to reload an aggregate ?
Either it's too obvious and it's useless to talk about it
Either it's not the right thing to…

Topic
- 77
- 5
0
votes
1 answer
DDD - Invariant enforcement using instance methods and a factory method
I'm designing a system using Domain-Driven design principals.
I have an aggregate named Album.
It contains a collection of Tracks.
Album instances are created using a factory method named create(props).
Rule 1: An Album must contain at least one…

Amirhosein Al
- 470
- 6
- 18
0
votes
1 answer
Where I put models when they are not related to aggregate root like configuration tables
I have a microservice called reward. When a customer does a certain activity in a different microservice(spent a specific amount of money), that service publishes an event, lets say SpentRewardingMoney.
In reward service, my aggregate root is…

Moshi
- 1,385
- 2
- 17
- 36
0
votes
2 answers
Product, Category, Attributes modelling in DDD
I'm trying to model online shop catalog using Domain Driven Design.
There are three main concepts I have right now: Product, Category, Attribute.
Attribute is a characteristic of a product. For instance things such as color, weight, number of CPU…

JoeFerreiro2266
- 1
- 1
0
votes
3 answers
DDD: Aggregate root or Entity Key design, Should the key UUID or unique number be generated by the system?
In my business logic, A User can be identified by his/her mobile phone number. 3rd party verification system ensures that the customer's phone number exists in real, and the system checks the uniqueness before insert User record into the table. From…

Junsuk Park
- 193
- 1
- 13
0
votes
2 answers
DDD - Large aggregate and enforce invariant across aggregates
I'm kind of stuck at modeling this problem in the right way applying Domain Driven Design way. I want to model travelling group in a traveling agency.
We have concepts like passenger, group, and group member in one bounded context. This passenger is…

Gru97
- 471
- 5
- 8
0
votes
1 answer
Can AggregateRoot reference another root if same aggregateroot type?
I am modeling an inventory application where items are managed and grouped into a containers and assign one unique number which will identify the inventory instance and can easily manage using RF IDs in warehouse. In these scenarios a container can…

biju
- 1
0
votes
1 answer
Domain Driven Design - Inheritance in ValueObjects
User {
name: String;
paymentType: PaymentType;
}
PaymentType {
//Common attributes
}
Can the above PaymentType(ValueObject) be inherited by these ValueObjects(Subclasses) - Credit, Cash, Cheque ?
There is a…

Sneh
- 413
- 1
- 5
- 18
0
votes
2 answers
Modelling Aggregate Roots with EF Core 3.X
Lets say I have these entities:
Customer
Order
Product
All three are aggregate roots, because all three need to be loaded and modified independently of one another. Since aggregate roots cannot contain other aggregate roots, for the Order…

User20909
- 105
- 10
0
votes
2 answers
Populate aggregate root from multiple databases
I am a beginner in DDD and would like to understand if it is a bad practice to try to populate a single aggregate root from multiple database ?
I am trying to design a system where all the properties of an aggregate root are being populated from…

Rahul
- 403
- 3
- 9
0
votes
2 answers
Confusion with entities and aggregate roots for patients, dentists, treatments and medical history
I am new to DDD and decided to practice it with a dental clinic system I'm developing, but I'm struggling with modeling the domain so an extra pair of eyes will be greatly appreciated.
For this dentistry system, the domain expert told me that a…

FernanJC
- 25
- 1
- 6
0
votes
2 answers
DDD, Aggregate Root and entities in library application scenario
I'm building a library application. Let's assume that we have a requirement to let registered people in the library to borrow a book for some default period of time (4 weeks).
I started to model my domain with an AggregateRoot called Loan with code…

XardasLord
- 1,764
- 2
- 20
- 45
0
votes
1 answer
If an Entity becomes the root of an Aggregate, does the Aggregate Root use the existing ID of the root Entity or does the AR create its own ID?
In Domain Driven Design (DDD), an Entity always has its own unique identity.
In my reading on DDD I have seen statements and examples that seem to mix the concepts of "unique identity" between Entities and Aggregate Roots. Depending on the example,…

Kerry
- 341
- 2
- 11
0
votes
2 answers
Which project in a solution to add a Domain Service that spans two aggregates?
I currently have two projects within one Visual Studio solution. Each project represents a different aggregate. I need to add a domain service that interacts with the two aggregate roots. Which project should I add it to? Does it matter?

Mike Lenart
- 767
- 1
- 5
- 19
0
votes
2 answers
Aggregate roots vs aggregates in a hierarchical system
I've been doing a lot of research on DDD and have been stumbling a bit on the concept of Aggregates vs Aggregate Roots.
Say I'm trying to model a space game that exists in a strict hierarchy, with a Sector Entity that wraps around everything…

Cowman
- 678
- 7
- 25