modular-monolith-with-ddd
modular-monolith-with-ddd copied to clipboard
Ambiguous `_location` in MeetingGroup
Hi, Kamil!
Here, when we create Meeting
we specify the location. MeetingGroup
in turn also has _location
which is not used anywhere, so I wonder, what sense does it make to have _location
in MeetingGroup
considering that we don't use it and specify other location when creating Meeting
? 🤔
https://github.com/kgrzybek/modular-monolith-with-ddd/blob/37de06228f3f6f49de20a510d5349c784903b01f/src/Modules/Meetings/Domain/MeetingGroups/MeetingGroup.cs#L96-L123
Hi @shamil-sadigov
As far as I remember, in Meetup
application, you have a location for a Meeting Group and for particular Meetings.
Location from Meeting Group is used in the Read Model: https://github.com/kgrzybek/modular-monolith-with-ddd/blob/548c1c28d597fa4b7f675f211cb045e5d9e0b067/src/Modules/Meetings/Application/MeetingGroups/GetAllMeetingGroups/MeetingGroupDto.cs
One note: According to DDD Aggregate definition you should not have attributes which are not used to protect business invariants. This is that case and location should be moved outside the aggregate. However, I am not such a orthodox and sometimes I keep more data in an aggregate if it does not affect performance and causes concurrency issues.