知识卡片
航运教学案例把客户约定直接接入交付场景
航运教学例抽取 Delivery 后,不只是搬类:图15.3让 Customer Agreement 直接约束 Handling Step,把交付约束显性化;又让约定直接关联 Cargo,免去每次经由 Customer 查找协议的路径。
这使“交付时按约定处理货物”的场景更直接,也给把通用的 Customer 类移出核心提供了理由。原书说约定须在订舱时挂到 Cargo;这是一项模型设计要求,图示没有证明它已在真实系统中上线。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第15章|Segregated Core · 查看原书依据
In the refactored model, the Customer Agreement is attached directly to the Cargo, rather than requiring a navigation through the Customer. (It will have to be attached when the Cargo is booked, just as the Customer is.) At actual delivery time, the Customer is not as relevant to operations as the agreement itself.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第123章《Segregated Core》(源文件:_epub-src/0321125215_ch15lev1sec7.html;单元02–03)
- 结论依据:原文逐项说明协议对装卸步骤的约束、直接挂货物的原因和对 Customer 出核心的影响,图15.3显示两条约束。
- 原始内容:First, the Customer Agreement now constrains the Handling Step. This is typical of the insights that tend to arise as the team segregates the CORE. [...] The other change is more pragmatic. In the refactored model, the Customer Agreement is attached directly to the Cargo, rather than requiring a navigation through the Customer. (It will have to be attached when the Cargo is booked, just as the Customer is.) At actual delivery time, the Customer is not as relevant to operations as the agreement itself. In the other model, the correct Customer had to be found, according to the role it played in the shipment, and then queried for its Customer Agreement. This interaction would clog up every story you set out to tell about the model. The new association makes the most important scenarios as simple and direct as possible.
- 转录说明:`[...]` 标明模型改动两段间省略;原 EPUB 强调标签边界造成的术语前空格已规范转录。