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
13
votes
2 answers

Aggregate Root support in Entity Framework

How can we tell Entity Framework about Aggregates? when saving an aggregate, save entities within the aggregate when deleting an aggregate, delete entities within the aggregate raise a concurrency error when two different users attempt to modify…
Brian Low
  • 11,605
  • 4
  • 58
  • 63
12
votes
2 answers

Bounded context implementation and design

Let's say I have two bounded contexts, the Shipping Context and the Billing Context. Each of these contexts need to know about the customer. At a data level, the customer is represented by a CustomerTbl table in a database. This table consists of…
12
votes
1 answer

Aggregates in CQRS

What are aggregates and how are they used in CQRS (Command-Query-Responsibility-Segregation) and ES (Event-Sourcing)? I'm new to this kind of architecture, and I'd be really happy if someone could please explain this to me. Thanks!
shmuli
  • 5,086
  • 4
  • 32
  • 64
12
votes
2 answers

one repository for each root aggregate entity in domain driven design

If you follow the repository pattern they... say to create a repository for each root aggregate entity. That means when I have this model: customer has orders order has products product has supplier etc... That would mean I have 4 repositories which…
Elisabeth
  • 20,496
  • 52
  • 200
  • 321
11
votes
4 answers

DDD - How to design associations between different bounded contexts

I have setup a domain project which is being populated with an ORM. The domain contains of different aggregates each with its own root object. My question is how properties that cross the aggregate boundries should be treated? Should these…
Laoujin
  • 9,962
  • 7
  • 42
  • 69
11
votes
4 answers

Should lookup values be modeled as aggregate roots?

As part of my domain model, lets say I have a WorkItem object. The WorkItem object has several relationships to lookup values such as: WorkItemType: UserStory Bug Enhancement Priority: High Medium Low And there could possibly be more, such as…
Landon Poch
  • 832
  • 1
  • 8
  • 19
10
votes
1 answer

Entity vs Aggregate vs Aggregate Root

I am struggling to identify Domain objects. Problem: A company has one or multiple Sites A Site has main and multiple contacts Thus, a company has one or many contacts. These contacts are allocated to Sites. Contacts must be added to Sites not…
MJK
  • 3,434
  • 3
  • 32
  • 55
10
votes
3 answers

Aggregate root with Entity Framework using Domain Driven Design

I am building an application using Domain Driven Design that is using Entity Framework. My goal is to allow my domain models (that get persisted with EF) contain some logic within them. Out of the box, entity-framework is pretty nonrestrictive as to…
Matthew
  • 24,703
  • 9
  • 76
  • 110
9
votes
3 answers

DDD: refer to an entity inside an aggregate root by its identity

I'm stuck on finding the proper way to refer to entities located inside an aggregate root, when we only got their identities coming from URL parameters. I asked a previous question which ended up focused on value objects, so I'm starting with…
BenMorel
  • 34,448
  • 50
  • 182
  • 322
9
votes
3 answers

DDD: Getting aggregate roots for other aggregates

I've been studying DDD for the past 2 weeks, and one of the things that really stuck out to me was how aggregate roots can contain other aggregate roots. Aggregate roots are retrieved from the repository, but if a root contains another root, does…
9
votes
3 answers

Aggregate roots. How far does the rabbit hole go

I'm trying to use the Repository pattern for my current project and i'm currently in the process of trying to model the domain and find the aggregate roots. I've read of the 'Cascading Delete' rule which states that if it doesn't make sense to…
9
votes
2 answers

DDD - Enforce invariants with small aggregate roots

I'm having my first attempt at DDD and I'm running into a problem with aggregate design. My application contains 3 Entities; Graph, Node, Link. Each of these entities has a name property which can be modified by the user (which I believe makes…
tonyj444
  • 383
  • 4
  • 13
9
votes
1 answer

DDD: can a Repository return entities inside an aggregate?

I have a City aggregate, having a list of PointOfInterest entities. This latter entity lies logically inside the City aggregate for reasons that won't be explained here. No entity holds a link to PointOfInterest, apart from the aggregate root,…
BenMorel
  • 34,448
  • 50
  • 182
  • 322
8
votes
2 answers

DDD functional way: Why is it better to decouple state from the behavior when applying DDD with functional language?

I've read several articles (also the book Functional domain modeling) where they propose to decouple state of the domain object from the behavior, but I cannot understand advantage of such approach over reach domain model. Here is an example of…
8
votes
4 answers

DDD - Enforcing rules which need to know about multiple aggregate roots

I'm new to DDD, and currently looking at rebuilding an existing application by starting with a bit of a proof of concept while I'm still finding my way with DDD. My questions here only concern a small part of the domain model, so it may seem overly…
Stu Ratcliffe
  • 269
  • 3
  • 14
1
2
3
29 30