对于我的问题,我找不到具体的答案,但是我将如何为下面的场景开发一个AggregateRoot类。
public class Root{
public int Id {get;set;}
public IList<Child> Children {get;set;}
}
public class Child{
public int Id{get;set; }
public IList<SubChild> SubChildren{get;set; }
}
public class SubChild{
public int Id {get;set;}
}根类如何按照DDD原则更新SubChild类?
发布于 2018-01-20 19:52:01
您想要做的事情违反了德米特定律。Subchildren只应由Child管理,而不是由Root类管理。
您可能会这样想,就像您的Root是一个聚合,Child -是一个子聚合。
https://softwareengineering.stackexchange.com/questions/364154
复制相似问题