我对整个领域驱动设计有点陌生,如果您能告诉我您认为这样的服务方法属于应用程序或领域层的哪个位置,我会很高兴:
List<Children> getChildrenByParent(Parent parent, int offset, int count) {
return repository.listChildrenByParent(Parent parent, int offset, int count);
}
我还想知道当模型中有大量实体和/或我需要有效过滤事物时,这是否是一种可接受的处理方式。
谢谢
最佳答案
您列出的方法似乎没有任何意义。为什么要创建一个 完全 包装 repository.listChildrenByParent 的方法 getChildrenByParent?它已经在正确的位置 - 在存储库上。只需在需要的地方使用 repository.listChildrenByParent。
关于domain-driven-design - 这是 DDD 应用程序还是域服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4146176/