Frage

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.

Keine korrekte Lösung

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top