DDD - the rule that Entities can't access Repositories directly

后端 未结 11 1427
栀梦
栀梦 2020-11-28 00:24

In Domain Driven Design, there seems to be lots of agreement that Entities should not access Repositories directly.

Did this come from Eric Evans Domain Driven Desi

11条回答
  •  一向
    一向 (楼主)
    2020-11-28 00:50

    simply Vernon Vaughn gives a solution:

    Use a repository or domain service to look up dependent objects ahead of invoking the aggregate behavior. A client application service may control this.

提交回复
热议问题