知识卡片
接口范围影响顺从与翻译的选择
现成组件与应用由不同团队控制,仍是两个限界上下文。若接触接口很大且组件在该领域的模型可用,沿用其概念通常比为大量数据逐项翻译更合算;可用适配器处理轻微格式差异。若接口很小,维持各自模型并翻译也可行。
因此不应仅因“外部组件”就一律加防腐层,也不应为了复用组件就让本地模型在无关领域全盘顺从。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第14章|Following Isn't Always Bad · 查看原书依据
When your interface with a component is small, sharing a unified model is less essential, and translation is a viable option. But when the interface is large and integration is more significant, it usually makes sense to follow the leader.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第108章《Following Isn't Always Bad》(源文件:_epub-src/0321125215_ch14lev1sec7_split_001.html;单元01)
- 结论依据:原文以组件接口大小和集成深度区分顺从模型与翻译,并将顺从限定在接触领域。
- 原始内容:When your interface with a component is small, sharing a unified model is less essential, and translation is a viable option. But when the interface is large and integration is more significant, it usually makes sense to follow the leader.