知识卡片
交付历史借用货物身份
每件货物的交付历史是其实际经历,不能与另一件货物的历史互换,因此原书把 Delivery History 判为实体。但它与所属 Cargo 一对一,不需再设计独立业务身份,可借货物身份识别。后续仍须由聚合边界约束外部如何访问这段历史;“没有独立编号”不意味着它是值对象。参见[[交付历史与交付目标分离]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第07章|Distinguishing Entities and Value Objects · 查看原书依据
Delivery Histories are not interchangeable, so they are ENTITIES. But a Delivery History has a one-to-one relationship with its Cargo, so it doesn't really have an identity of its own. Its identity is borrowed from the Cargo that owns it.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第51章《原书第07章|Distinguishing Entities and Value Objects》(源文件:_epub-src/0321125215_ch07lev1sec3.html)
- 结论依据:原文明确交付历史不可互换,属于实体;因与货物一对一,其身份借自货物,并预告聚合建模会进一步澄清。
- 原始内容:Delivery Histories are not interchangeable, so they are ENTITIES . But a Delivery History has a one-to-one relationship with its Cargo , so it doesn't really have an identity of its own. Its identity is borrowed from the Cargo that owns it.