I am needing some assistance with designing with DDD.I have three classes, Family, Child and event. Is the correct way to model this to to have Child in both Event and Family and make Family and Event an Aggregate Root. My question is it ok to have an Entity as a member of two AggregateRoot?    public class Child: Entity    {     ...properties and methods....    }    public class Family : AggregateRoot    {        private List<Child> _attendingChildren;        public void NewChildInFamily(string firstName, string surname)        {....create a new child and add it to attendingChildren....}    }    public class Event: AggregateRoot    {       private List<Child> _attendingChildren;       public void NewChildAttending(Child attendingChild)       { ....code to add existing child to attendingChildren....}    }
Domain Driven Design. Aggregate Root
domain driven design
No, this breaks the encapsulation of the aggregate, because Event is referencing Child, which is under other Aggregate root.All 3 should be roots.