You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
A lot of thanks for Your work. I study ddd in practice, so I try to implement relationship between domain and its entities. I struggle for few days and can not find the correct answer. Let's imagine, that our user will have the profile and address (separate entities). I have readModels, e.g. profileReadModel and addressReadModel. They are in infrastructure level of the application. So my question: can I use advantages of the doctrine relations handling in this level?
Let's imagine I need something like this in response:
{"user": {"id": "", "name": "", "address": {"city": "", "zip":""}, "profile": {"bio": "", "lastjob": ""}}}
If address and profile of the userReadModel will have UuidInterface type (as ddd claims https://matthiasnoback.nl/2018/06/doctrine-orm-and-ddd-aggregates/) i think it will be problems with perfomance, because I have to query database for a three times to provide the response. If I'll need a 100 users there will be much more queries.
Do You have some hints for me?
The text was updated successfully, but these errors were encountered:
My point will be: Use embedded in infrastructure objects like here. That will eliminate the need of extra queries. Data structure is an implementation details AKA infrastructure and should serve it purpose. There perfect database design is the one that serve his purpose efficiently, I see many times tends to design schemas with no data duplication and only the theoretically needed relationships. The database is not the domain model. A table is not an entity. In some cases, and entity can live in a json column and be fine.
Hi.
A lot of thanks for Your work. I study ddd in practice, so I try to implement relationship between domain and its entities. I struggle for few days and can not find the correct answer. Let's imagine, that our user will have the profile and address (separate entities). I have readModels, e.g. profileReadModel and addressReadModel. They are in infrastructure level of the application. So my question: can I use advantages of the doctrine relations handling in this level?
Let's imagine I need something like this in response:
{"user": {"id": "", "name": "", "address": {"city": "", "zip":""}, "profile": {"bio": "", "lastjob": ""}}}
If address and profile of the userReadModel will have UuidInterface type (as ddd claims https://matthiasnoback.nl/2018/06/doctrine-orm-and-ddd-aggregates/) i think it will be problems with perfomance, because I have to query database for a three times to provide the response. If I'll need a 100 users there will be much more queries.
Do You have some hints for me?
The text was updated successfully, but these errors were encountered: