-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Please show how you would create new ToDoItems #529
Comments
Adding todoitems is done in #530.
Ok so you're figuring there are N contributors assigned to M ToDoItems on 1 Project, and on that 1 Project each contributor has a specific title or role that is specific to that project only (so it's not part of the Contributor entity), right? The initial/current design just has Probably what I would do is add a collection of contributor titles (perhaps named public class ContributorAssignment : EntityBase
{
int ContributorId { get; private set; } // require in ctor
int ProjectId { get; private set; } // require in ctor
string Title { get; private set; } // require in ctor
// perhaps metadata like DateCreated, etc.
} This entity could live either in the Contributor aggregate or the Project aggregate (or both) but in this case I'd put it in ProjectAggregate. Now you have the problem, what happens if you add a ToDoItem with a ContributorId that isn't in the list of assignments? This is a business rule problem so the answer depends on the rules. Maybe it's fine and the UI just lets the user know there is a new contributor with no title involved in the project. The user can fix that whenever they want. Or maybe it's critical to the invariants of a project that every contributor have a title. In that case, You would also have to address the case of modifying a ToDoItem to change its Does that help? |
It is helpful and thanks for responding. I wasn't clear in my question, and honestly the Many-To-Many portion should probably have been a separate issue. It was not directly related to the I suppose my question just turns into "How would you model group and group membership" in this domain, which you've more or less answered. I was confused and wondered, if we're going to give a Thanks, |
In this template, you aggregate ToDoItems within the ProjectAggregate. However, you also stop short of showing how you would, via API, author new ToDoItem instances. I think it would be beneficial to show how you would create these new child items of a project.
I think it would be wonderful to see:
Thanks for such a great template!
The text was updated successfully, but these errors were encountered: