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
1 answer
DDD using repository in entity for validation before update
Let's say I wan't to update a nickName of Person entity, with rule that this nickName is used by up to 5 other Persons. How should I do it?
Should I do validation in domain service, before calling an update?
Or is it better to pass a…

bastiat
- 1,799
- 2
- 19
- 38
0
votes
1 answer
DDD About a design decision
I have to solve a domain problem and I have some doubts about what is the better solution. I am going to present the problem:
I have Applications and each Application has many Process. An Application has some ProcessSettings too. I have some…

user1129875
- 3
- 2
0
votes
1 answer
Domain Driven Design Model Setup
I have spent the last few weeks enjoying learning about Clean Architecture and Domain Driven Design and I would now like to use it for a personal project to try it out. But I am having trouble with a few key concepts regarding modelling my domain…

unknownpresense
- 99
- 9
0
votes
1 answer
DDD - how to model aggregate root?
I have a domain called product_catalog.
In my domain a Brand can owns many products. (1 to Many relationship)
A category could have many products, and a product could belong to many categories. It's a N-to-M relationship.
If I design product as the…

p.magalhaes
- 7,595
- 10
- 53
- 108
0
votes
1 answer
DDD: Aggregates and Deletes
It's taken awhile but I feel I've started to build a good understanding of aggregates in DDD. Keep them small (An Entity with Value Objects whenever possible) and when containing multiple entities, ensure their reason to exist is to enforce some…

Steven
- 823
- 8
- 25
0
votes
2 answers
Updating Value objects or Inserting new Record in DB
I have a Ticket table and its Receivers which is a collection. Receiver is a value object.
I defined all in EF Core 2.2 and everything is Okay.
When inserting a new ticket, receivers are added to ticket and would be saved.
For updating ticket, as…

unos baghaii
- 2,539
- 4
- 25
- 42
0
votes
1 answer
EventSourcing for Aggregates that rely on other aggregates
I'm currently working on a calendar system written in an EventSource style.
What I'm currently struggling with is how to create an event which create lots of smaller events and how to store the other events in a way which will allow them to be…

Harry
- 73
- 5
0
votes
1 answer
Association between aggregates, how to decide between holding reference to the object or only to its identity
For exemple, giving a performance having multiple performers...
First option:
Performance (1) ---> (*) Performer
Second option:
Performance
+PerformerIds[]
1st option Pros:
Easier access for query purpose (lets say I don't want to use CQRS)
When…

Jonathan
- 1,276
- 10
- 35
0
votes
1 answer
two aggregate roots in fluent nhibernate
The problem is that I have two aggregate roots
The Aggregate roots are
Project.
NewsArticle.
A Project can have a collection of related NewsArticle.
A NewsArticle can have a collection of related Projects.
The requirements are that:
A user can…

defong
- 91
- 5
0
votes
2 answers
Domain Driven Design- How to aggregate a turn based game
I am designing a game in a corporate business. Its a turn based game .
Invariants:
a) A Game has two Players at least , a Start Date and other
properties.
b) Each Player plays a turn inside a Game.
c) A member
when joins a Game becomes a…

X.Otano
- 2,079
- 1
- 22
- 40
0
votes
1 answer
How to create two Aggregates from one View
I have two Aggregates called CompanyAggregate and ProfileAggregate and their Aggregate Root are Company and Profile respectively, a Company can have many Profiles. The view responsible for creating Companies has the possibility to create Profiles…

Ariel Moraes
- 602
- 7
- 15
0
votes
1 answer
Can Aggregate Root Factory create the root, and it's internal classes?
Currently, my aggregates and value objects have protected constructors and almost all of them are being created by static factory methods inside the aggregate with descriptive names. It creates a nice DSL and pretty encapsulated model but makes the…

Mohsen
- 4,000
- 8
- 42
- 73
0
votes
3 answers
In Microservices is it acceptable to have an API returning an Aggregate Root that was replicated?
Imagine we have a microservice M1 with an aggregate root called Player and a microservice M2 with an aggregate root called Classification, now in the M1 we need to do some logic based on some property from Classification, now some steps to do that…

Ariel Moraes
- 602
- 7
- 15
0
votes
1 answer
Map commands to value objects in CQRS
On one hand, the invariants should be protected (To make invalid states impossible early and preferably at compile time rather than run time), and on the other hand, passing domain knowledge out of the domain is wrong.
On one hand, the value objects…

Mohsen
- 4,000
- 8
- 42
- 73
0
votes
1 answer
Handling aggregate root
I'm new in DDD so I'm doing some practice to undertand a little bit more. I have Course BC with the follow rules:
Course has to be created first and then they can create the modules of one course
Every module will be finished by the user when he…

Agustin Castro
- 439
- 1
- 6
- 20