문제

I'm fairly new to DDD and have read a few articles about the concept so pardon if I'm lacking some knowledge. I'm curious on how this example should be modeled with aggregate roots.

The basis is: There is an Employee, a Meeting and Comments. Each Employee can attend a Meeting where they can make Comments. The Comments are tracked according to Employee and Meeting. Every Meeting and Employee have unique identifiers.

If I wanted to display all Comments from a Meeting, regardless of the Employee, would I first have to get all the Employees that belong to that Meeting and then sort through the Comments to only show ones that match the Meeting Id?

Meeting can't be my aggregate root because when I need a list of Employees, I certainly do not want to have to go through meetings to get that. Maybe each one is an aggregate root, but Comments do not make sense really outside an Employee. I'm looking for ideas on how to better approach this scenario.

// Datebase tables
Meeting
Employee
Comment - Contain EmployeeId and MeetingId


public class Employee
{
    public List<Comment> Comments { get; set; }
}

public class Meeting
{
    public List<Employees> Employees { get; set; } 
}

Thanks in advance for the help.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top