DDD: Aggregate Roots

前端 未结 3 684
醉酒成梦
醉酒成梦 2020-12-28 23:47

I need help with finding my aggregate root and boundary.

I have 3 Entities: Plan, PlannedRole and PlannedTraining. Each Plan can include many PlannedRoles and Plann

3条回答
  •  [愿得一人]
    2020-12-29 00:18

    Real problem here is SRP violation. Your input part of app goes in conflict with output.

    Stick with first solution (Plan==aggregate root). Artificially promoting entities (or even value objects) to aggregate roots distorts whole domain model and ruins everything.


    You might want to check out so called CQRS (command query responsibility segregation) architecture which would fit perfectly to fix this particular issue. Here's an example app by Mark Nijhof. Here's nice 'getting-started' list.

提交回复
热议问题