知识卡片
同目标规格可共享而历史不可共享
Delivery Specification 描述希望达到的状态,不依附某件货物的经历;两件去同一地点且目标相同的货物,可以共享等值规格。Delivery History 则记录各自真实发生的事,即使起初都为空,也不能共用同一个历史对象。因此原书把规格判为值对象、历史判为实体。Role 也无历史连续性,是描述关联的值对象。参见[[值对象按描述而非身份理解]]、[[交付历史借用货物身份]]。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第07章|Distinguishing Entities and Value Objects · 查看原书依据
If we had two Cargoes going to the same place, they could share the same Delivery Specification, but they could not share the same Delivery History, even though the histories start out the same (empty). Delivery Specifications are VALUE OBJECTS.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第51章《原书第07章|Distinguishing Entities and Value Objects》(源文件:_epub-src/0321125215_ch07lev1sec3.html)
- 结论依据:原文对照两件货物可共用相同交付规格、不能共用即使初始为空的交付历史,并明确规格和角色是值对象。
- 原始内容:If we had two Cargoes going to the same place, they could share the same Delivery Specification , but they could not share the same Delivery History , even though the histories start out the same (empty). Delivery Specifications are VALUE OBJECTS .