Questions tagged [aggregateroot]

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.

441 questions
0
votes
1 answer

Retrieve entity reference other aggregate by ids

One aggregate has to reference other aggregate by ids, for instance: order stores userId. So if I need the user entity to do something in the order aggregate I should pass it like this: order.doSomthing(user). But where should I retrieve the user in…
Agustin Castro
  • 439
  • 1
  • 6
  • 20
0
votes
4 answers

DDD => behaviour in root aggregate : instanciate other root aggregate

I have 2 root aggregate : - invoice - complaint And I have a rule who say : "I can't delete an invoice if a complaint is opened on it". On my delete behaviour on invoice aggregate I want to check if a complaint exist like : Complaint complaint =…
julien M
  • 3
  • 1
0
votes
1 answer

Manage Aggregates entities (DDD)

During my draft project I'm wondering about DDD Aggregate Root and its Entities. Let's say that my aggregate is Ticket model and it contain entities of its Replies. How should I menage my Replies? Every examples shows that I should manage Replies…
0
votes
1 answer

How to reference two AggregateRoots in DDD

I have two domain objects, a Parent and Child. A Parent can have zero or more children, and a Child can belong to zero or more parents (in case of divorced parents). So thinking about this in the context of Domain Driven Design I'd say that both…
Vivendi
  • 20,047
  • 25
  • 121
  • 196
0
votes
1 answer

How to determine the aggregate root

I have an application in which an Engineer accesses gas wells. He can see a list of wells by choosing any combination of 7 characteristics. The characteristics are company, state, county, basin, branch, field, operator in their respective order. …
William
  • 317
  • 2
  • 12
0
votes
1 answer

What is the most correct method of updating an Aggregate through an Aggregate Root?

Following the good practices of DDD, Aggregate and Aggregate Root. I have the following scenario: User (Aggregate Root) A collection of UserEmail (inside User) Imagining that I have registered a User with 10 Emails, what would be the most correct…
0
votes
3 answers

Best practices to work with references in aggregate roots and entities

Lets say I have aggregate root A which has entity B aggregate root C which has entity D I've read that best practice is to hold object Id inside aggregate roots instead of direct references, for example A->C_Id and C->A_Id. can aggregate hold Id…
Artur
  • 11
  • 1
  • 4
0
votes
2 answers

DDD: How to solve this using Domain-Driven design?

I'm new to DDD and cutting my teeth on the following exercise. The use case is real, but my attempt to solve it with DDD is purely for learning. We have multiple Git repos, each containing a file that we call product spec. The system needs to…
0
votes
1 answer

DDD - Aggregate Root holding reference for a domain service

Is it acceptable that my aggregate root holds a reference for a domain service in order to "save itself" while not holding reference to any repository? The idea behind this is not have a application service with code like…
Leonardo
  • 10,737
  • 10
  • 62
  • 155
0
votes
1 answer

Effective aggregate root design in DDD (Vernon's explanations)

I have a question regarding the design of aggregates, as presented by Vernon, both in his articles in the DDD community (Effective Aggregate Design, Part 3) as well as on his book (Implementing Domain-Driven Design). In there, he explores two…
user2465039
  • 894
  • 1
  • 11
  • 28
0
votes
2 answers

Should AggregateRoot contain collection of other AggregateRoot?

I've read this interesting topic in order to study DDD and found out a new idea that the author said "the argument for not making a ‘ProductReviews’ collection inside the Product class". Because "There are no true invariants between these two…
Cephas PAD
  • 82
  • 9
0
votes
2 answers

How to persist unfinished Aggregate Root in invalid state?

I have an aggregate root that needs to be in valid state in order to be used in the system properly. However, the process of building the aggregate is long enough for users to be distracted. Sometimes, all user wants is to configure some part of…
0
votes
1 answer

Create aggregate root in the context of another aggregate root

i'm currently struggling with the creation of instances in the ddd context. i have read and searched alot and sometimes thought that i have found the answer only to realize that it doesnt feel right while programming it. This is my situation: I…
0
votes
2 answers

Deciding to make it a root of aggregate or to keep it as member of aggregate root.

I remember in Eric Evans book on DDD, if an entity can only be understood in term of other entity (the root of aggregate), then make it a "plain" entity (member of AR). My question: what exactly "can be understood on its own" means? What questions…
Cokorda Raka
  • 4,375
  • 6
  • 36
  • 54
0
votes
1 answer

CQRS & PurchaseOrder AggregateRoot

i am new to CQRS & DDD and for a practice i am using MS WideWorldImporters database, at the moment i am stuck on purchase order placement command, to say the truth i don't know how it should look like, can you guide me? Should i have 1…
QuietNaN
  • 371
  • 1
  • 14