知识卡片
仓储只给当前需要直达的聚合根
原书货运首版虽有五种聚合根,却只为当前应用须直接找到的四种设置仓储:订舱需选 Customer 与目的地 Location;记录装载需找 Cargo 与 Carrier Movement。Handling Event 暂由 Delivery History 的集合取得,当前也无按承运段独立查事件的需求,所以先不建仓储。若访问方式或需求改变,再加仓储。图7.4是案例当前阶段设计,并非第五类对象永远不得建仓储。参见[[全局查询只开放必要聚合根]]。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第07章|Selecting Repositories · 查看原书依据
For now there is no Handling Event Repository, because we decided to implement the association with Delivery History as a collection in the first iteration, and we have no application requirement to find out what has been loaded onto a Carrier Movement. Either of these reasons could change; if they did, then we would add a REPOSITORY.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第54章《原书第07章|Selecting Repositories》(源文件:_epub-src/0321125215_ch07lev1sec6.html;图7.4)
- 结论依据:原文从应用需求挑出四个仓储,明确暂不建立 Handling Event Repository 的两个条件及未来可变性。
- 原始内容:For now there is no Handling Event Repository , because we decided to implement the association with Delivery History as a collection in the first iteration, and we have no application requirement to find out what has been loaded onto a Carrier Movement . Either of these reasons could change; if they did, then we would add a REPOSITORY .