I am starting to work with DDD, working on small, simple domains to get an idea of โโall the design principles.
I have this simple domain: Institution
and their available WiFi points ( Place
) are stored in a database. No place can exist without an institution. The institution has a manager-user-successor ( User
), which has the right to add new places, redistribute or delete existing ones.
The code can be found here . At the moment, validation of value objects is left.
This is affected by Mathias Verraes on child objects .
Is this the correct DDD design? or at least close to it?
As a data-oriented programmer, I am still wondering how I would list all the places for all Institutions if the rule of thumb has access to aggregates through an aggregate root?
Is the idea of โโgenerating Uuid
inside the entity itself ( Place::create
) good?
Should there be an idea that only the User
assignee can add / remove places that will be expressed in the domain itself or should it be responsible for the client? In this case, it would be reasonable if the assignee knew about his managed institution ( institutionId
in User
?).
Isn't Institution::placeById
violating any DDD principles? Perhaps this is the responsibility of the repository?
source share