知识卡片

普通读书笔记卡 · 1971.o.1.b.1.a.2.c.2

统一冲突模型需新抽象

理解等级:高级

当多个上下文要共享更多信息,单一模型的价值会上升,但不能简单选一个人的局部模型作全局真相。原书的教学比喻先把“墙、树、蛇、绳”放进一个整体,得到粗糙的部分—整体关系;这可满足初步需求。

更难的是两种模型解释同一部分却互相冲突,例如把象鼻分别看作蛇和消防水管。此时要造新抽象,保留“有生命、能喷水”等有效性质,并去掉毒牙、可拆下卷起等错误暗示。应用推断:可借[[上下文图记录模型边界与接触点]]先定位需要共同建模的冲突处。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 原书第14章|Unifying an Elephant · 查看原书依据

      In fact, they need a new abstraction that incorporates the "aliveness" of a snake with the water-shooting functionality of a fire hose, but one that leaves out the inapt implications of the first models, such as the expectation of possibly venomous fangs, or the ability to be detached from the body and rolled up into a compartment in a fire truck.

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第113章《Unifying an Elephant》(源文件:_epub-src/0321125215_ch14lev1sec12.html;单元02) - 结论依据:原文指出模型合并常需新模型;同一部分的不同解释须在新抽象中保留有效性质并排除不适合的暗示。 - 原始内容:As the blind men want to share more information about the elephant, the value of sharing a single BOUNDED CONTEXT goes up. But unifying the disparate models is a challenge. [...] Unifying multiple models almost always means creating a new model. With some imagination and continued discussion (probably heated), the blind men could eventually recognize that they have been describing and modeling different parts of a larger whole. For many purposes, a part-whole unification may not require much additional work. At least the first stage of integration only requires figuring out how the parts are related. It may be adequate for some needs to view an elephant as a wall, held up by tree trunks, with a rope at one end and a snake at the other. [...] Matters are more difficult when two models are looking at the same part in a different way. If two men had touched the trunk and one described it as a snake and the other described it as a fire hose, they would have had more difficulty. Neither can accept the other's model, because it contradicts his own experience. In fact, they need a new abstraction that incorporates the "aliveness" of a snake with the water-shooting functionality of a fire hose, but one that leaves out the inapt implications of the first models, such as the expectation of possibly venomous fangs, or the ability to be detached from the body and rolled up into a compartment in a fire truck. - 转录说明:两处 `[...]` 分别标明拒绝单纯采用某个局部模型的论述,以及“部分与整体”容易统一的例外说明;应用推断并非原书实施案例。