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
7
votes
1 answer
DDD Customer, Contacts, and Addresses (aggregate root)
I'm building an application that manages most of the LOB stuff at my company. I'm trying to wrap my head around DDD... starting with customer management. Many examples are very, very simple in regards to the domain model which doesn't help me…

Chris Klepeis
- 9,783
- 16
- 83
- 149
7
votes
4 answers
Defining aggregate roots when invariants exist within a list
I'm doing a family day care app, and thought I'd try DDD/CQRS/ES for it, but I'm running into issues with designing the aggregates well. The domain can be described pretty simply:
A child gets enrolled
A child can arrive
A child can leave
The…

XwipeoutX
- 4,765
- 4
- 29
- 41
7
votes
1 answer
In Domain Driven Design, may a transaction modify more than one aggregate?
In "Domain Driven Design: Tackling Complexity in the Heart of Software", Evans defines
An Aggregate is a cluster of associated objects that we treat as a unit for the purpose of data changes.
Obviously this implies that an aggregate must be…

meriton
- 68,356
- 14
- 108
- 175
7
votes
1 answer
DDD: Aggregate Root accessed by another aggregate root
I am currently developing a DDD application and am confused about how to handle a scenario where it seems as if I have to access an aggregate root from another aggregate root. Here is an overview of my boundary contexts:
Users can join the site…

user1790300
- 2,143
- 10
- 54
- 123
7
votes
2 answers
Is Aggregate Root with Deep Hierarchy appropriate in DDD?
I have a system where a user answers question in a form. I have objects representing this model but I am not quite sure how to organize these objects in terms of DDD.
Form (has its own list of) Sections;
Section -> (has its own list of)…

ddv
- 135
- 2
- 6
7
votes
4 answers
When to update audit fields? DDD
I have a Meeting Object:
Meeting{id, name, time, CreatedBy, UpdatedBy}
and a
MeetingAssignee{id, MeetingID, EmployeeId, CreatedBy, UpdatedBy)
Meeting, as Aggregate root, has a method AssignEmployee.
I was about to pass in the current user to the…

user676767
- 255
- 2
- 12
6
votes
2 answers
What's the StreamId in EventSourcing when a domain event affects multiple aggregates in the same Bounded Context?
Streams
Some authors suggest to classify the events in "streams", and many authors identify the "stream" with the "aggregate Id".
Say an event car.repainted by which we mean we repainted the car with id 12345 into {color:red}.
In this example the…

Xavi Montero
- 9,239
- 7
- 57
- 79
6
votes
3 answers
DDD - How Can I Avoid Crossing Aggregate Boundaries Here?
We're working on a new project (re-writing existing app), and I'm running into problems with my domain model / repository design.
Here is a (simplified) version of two key portions in our domain model:
As you can see, I have an abstract concept of…

RPM1984
- 72,246
- 58
- 225
- 350
6
votes
1 answer
DDD - Share or duplicate a value object to be used between two aggregate roots?
If I have a payment value object can it be shared by two different aggregate roots? or should I duplicate it?
Both options feel wrong!

Cool Breeze
- 1,289
- 11
- 34
6
votes
3 answers
DDD: Persisting aggregates
Let's consider the typical Order and OrderItem example. Assuming that OrderItem is part of the Order Aggregate, it an only be added via Order. So, to add a new OrderItem to an Order, we have to load the entire Aggregate via Repository, add a new…

Mosh
- 5,944
- 4
- 39
- 44
6
votes
3 answers
DDD: Aggregate Roots
I need help with finding my aggregate root and boundary.
I have 3 Entities: Plan, PlannedRole and PlannedTraining. Each Plan can include many PlannedRoles and PlannedTrainings.
Solution 1: At first I thought Plan is the aggregate root because…

Mosh
- 5,944
- 4
- 39
- 44
6
votes
1 answer
domain driven design method duplication
I am currently working through the domain driven design book by Eric Evans, and there is one concept that I am having trouble with...
According to the book, all aggregates should have an aggregate root, and all members of the aggregate should only…

user3529475
- 71
- 3
6
votes
3 answers
How to handle concurrent constraints across aggregate roots
I'm afraid I already know the answer, but I'm hoping that somebody can provide an alternative solution that haven't found before. As always doing DDD according to Effective Aggregate Design is more difficult than I thought, but here's my scenario.…

Dennis Doomen
- 8,368
- 1
- 32
- 44
6
votes
1 answer
Aggregate Root in context of Repository Pattern
I understand that Aggregate Roots are the only object that will be loaded by the client and all operations for the objects within the aggregate root are done by the Aggregate Root. By the same convention, there should one repository interface…

devanalyst
- 1,348
- 4
- 28
- 55
5
votes
2 answers
How to identify aggregate roots in domain model?
Dabbling with domain driven design, I've run into a situation regarding how to identify aggregate roots within my domain model.
I have the following three classes, modelling a simple to-do list:
public class List {
private IList _tasks;
…

rob
- 1,154
- 2
- 12
- 18