Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous _location in MeetingGroup #199

Open
shamil-sadigov opened this issue Apr 28, 2021 · 1 comment
Open

Ambiguous _location in MeetingGroup #199

shamil-sadigov opened this issue Apr 28, 2021 · 1 comment

Comments

@shamil-sadigov
Copy link

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? 🤔

public Meeting CreateMeeting(
string title,
MeetingTerm term,
string description,
MeetingLocation location,
int? attendeesLimit,
int guestsLimit,
Term rsvpTerm,
MoneyValue eventFee,
List<MemberId> hostsMembersIds,
MemberId creatorId)
{
this.CheckRule(new MeetingCanBeOrganizedOnlyByPayedGroupRule(_paymentDateTo));
this.CheckRule(new MeetingHostMustBeAMeetingGroupMemberRule(creatorId, hostsMembersIds, _members));
return Meeting.CreateNew(
this.Id,
title,
term,
description,
location,
MeetingLimits.Create(attendeesLimit, guestsLimit),
rsvpTerm,
eventFee,
hostsMembersIds,
creatorId);
}

@kgrzybek
Copy link
Owner

kgrzybek commented Jun 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants