C
C#2mo ago
ZML

Help on defining aggregates using DDD

Hi, I'm working on a mini project for a spa management system in which I would like to familiarize myself with the concept of DDD (Domain-Driven Design). I have a general understanding of it, but I'm having trouble defining what should be an aggregate and what should not. Currently, I anticipate having the following classes in the system: Employee, Customer, Service, Salon, Product, Appointment, Sale, Invoice, Report, Schedule, Payment. Could someone guide me on which classes should be aggregates in this case? Thank you in advance for your help.
7 Replies
HtmlCompiler
HtmlCompiler2mo ago
it's all the stuff together for the feature*/operation you need -# * although this is more of a vsa terminology
canton7
canton72mo ago
Not really? Aggregates have a specific definition
HtmlCompiler
HtmlCompiler2mo ago
i make use of abp, and their definition is here https://abp.io/docs/latest/framework/architecture/domain-driven-design/entities but i have seen multiple
canton7
canton72mo ago
OP said DDD, which I'm assuming is the book by Evans Although that definition looks in line with what I remember by Evans
ZML
ZMLOP2mo ago
I understand the basic principles, but my issue is that in my system, the Administrator can create one (or several) Salons and then add employees, accounts for employees, services, products, clients, schedules, etc. When trying to define aggregates, it seems that I actually have one aggregate, the Salon, from which I can add and manage individual elements. If I were to break this down into several aggregates, I would have, for example, Salon, Employee, Reservation, but then the Salon aggregate would contain other aggregates, and I’m not sure if this is good practice.
HtmlCompiler
HtmlCompiler2mo ago
what do you mean by "breaking it down into sevel aggregates", why do that
ZML
ZMLOP2mo ago
I wanted to split it into smaller aggregates, because each of the elements (e.g. Employee, Reservation) has its own rules and life cycle. It seems to me that such an approach would allow for better management of business logic and transactions for each of these elements separately, instead of keeping everything in one aggregate Salon. Besides, I don't know, I'm really getting confused
Want results from more Discord servers?
Add your server