知识卡片
模型不统一也可先明确边界
原书用盲人摸象作教学比喻:各人对同一对象形成“墙、树、蛇、绳”等局部模型。若彼此无集成需求,让模型留在各自的[[限界上下文界定模型一致范围]]即可;若只需交换少量信息,例如大象的位置,先承认描述不同,再为所需信息做翻译。
明确边界能保留每个模型在自身语境内的完整性,也避免不同团队以为同一词指同一事物。是否统一,应由实际共享信息的需求决定。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第14章|Unifying an Elephant · 查看原书依据
Having established separate BOUNDED CONTEXTS, the situation is clear enough for them to work out a way to communicate with each other about the few aspects they care about in common: the location of the elephant, perhaps.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第113章《Unifying an Elephant》(源文件:_epub-src/0321125215_ch14lev1sec12.html;单元01–02)
- 结论依据:原文明确区分无集成需求与有限集成需求,并指出先认识到模型不一致即可避免沟通错位。
- 原始内容:Depending on their goals in interacting with the elephant, the various blind men may still be able to make progress, even if they don't fully agree on the nature of the elephant. If no integration is required, then it doesn't matter that the models are not unified. If they require some integration, they may not actually have to agree on what an elephant is, but they will get a lot of value from merely recognizing that they don't agree. This way, at least they don't unknowingly talk at cross-purposes. [...] Having established separate BOUNDED CONTEXTS, the situation is clear enough for them to work out a way to communicate with each other about the few aspects they care about in common: the location of the elephant, perhaps. [...] If the goal is simply to find the elephant, then translating between each model's expression of location will do. [...] Recognizing multiple, clashing domain models is really just facing reality. By explicitly defining a context within which each model applies, you can maintain the integrity of each and clearly see the implications of any particular interface you want to create between the two.
- 转录说明:`[...]` 分别标明图14.9说明、初步/深入统一讨论,以及译码后续细节;原 EPUB 强调标签边界造成的术语前空格已规范转录。