Questions tagged [aggregate]
An aggregate is either a group of related objects/data or the result of some operation on such group. The tag can be used for example for language specific data structures, algorithms that combine data and GROUP BY queries, UML relationships, or DDD aggregates that combine dependent objects.
174 questions
0 votes
2 answers
175 views
How could I map a complex DTO to a Domain Aggregate in a Repository?
I'm working on a TypeScript application designed with DDD and using layered architecture. My infra layer has a repository that fetches a complex, nested DTO. My current implementation maps this DTO ...
0 votes
1 answer
247 views
storing aggregates as json in postgresql all in one table
I am trying to decide what the best way of storing my data would be. I want to build a cqrs application where I also apply DDD principles like aggregates in the command side. I started with with ...
1 vote
2 answers
447 views
Pattern / Architecture to implement State Machine with "steps" between states
I'm looking for some guidance implementing the following problem: We have a set of 'states' which a user can enter into: 1.- Registered: A user registers themselves in the system and can start placing ...
0 votes
0 answers
177 views
DDD - Managing Relationships between Domain Aggregates
To understand DDD better, I am trying to create the Domain Layer of an online class application. I have a concept of a Student, Tutor and Session. I thought of having one aggregate called Session and ...
1 vote
3 answers
299 views
What are the DDD aggregates in package delivery system?
I'm trying to model a specific domain using DDD techniques and have some doubts. To better contextualize, a brief description: It's a domain of deliveries and delivery confirmation. We have two main ...
1 vote
5 answers
1k views
When designing aggregates, can a child entity store another aggregate root ID?
I’m currently trying DDD with establishments’ opening hours: OpeningHours is an aggregate root; it ensures its openings don’t overlap an Establishment can be set many opening hours (like summer’s, ...
0 votes
0 answers
226 views
Event sourcing, bulk update and storing multiple events vs one event with multiple ids
Event-sourcing often implies to have one row per aggregate id : event_id event_type entity_type entity_id event_data 102 OrderCreated Order 101 {...} 103 OrderUpdated Order 101 {...} This is perfectly ...
0 votes
2 answers
642 views
What if a Repository needs to apply Business Logic to load an Aggregate?
I have an aggregate User and the user has a Score. The Score of a user is calculated by queriying a bunch of different tables and running through (often very large) result sets applying some business ...