← 返回刚才阅读的位置

知识卡片

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

顺从上游模型换取集成简化

理解等级:高级

上游不与下游协作,而下游仍必须依赖它时,若上游模型质量尚可、风格相容,下游可在接触区域接受上游模型与语言,省去跨模型翻译。代价是依赖加深,设计自由受限;下游能力主要受上游模型约束,只能在其外作附加扩展。

这不是说上游模型在所有场景都最好,而是在“无法共同决策且翻译成本较高”的条件下作取舍。若代价不可接受、依赖又不可去除,应考虑另建隔离翻译层。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 原书第14章|Following Isn't Always Bad · 查看原书依据

      If these trade-offs are not acceptable, but the upstream dependency is indispensable, the second option still remains: Insulate yourself as much as possible by creating an ANTICORRUPTION LAYER, an aggressive approach to implementing a translation map that will be discussed later.

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第108章《Following Isn't Always Bad》(源文件:_epub-src/0321125215_ch14lev1sec7_split_001.html;单元01) - 结论依据:原文明确顺从上游模型简化集成,同时指出加深依赖、限制设计及扩展范围。 - 原始内容:On the other hand, if the quality is not so bad, and the style is reasonably compatible, then it may be best to give up on an independent model altogether. This is the circumstance that calls for a CONFORMIST . [...] Eliminate the complexity of translation between BOUNDED CONTEXTS by slavishly adhering to the model of the upstream team. Although this cramps the style of the downstream designers and probably does not yield the ideal model for the application, choosing CONFORMITY enormously simplifies integration. [...] This decision deepens your dependency on the upstream and limits your application to the capabilities of the upstream model—plus purely additive enhancements. [...] If these trade-offs are not acceptable, but the upstream dependency is indispensable, the second option still remains: Insulate yourself as much as possible by creating an ANTICORRUPTION LAYER , an aggressive approach to implementing a translation map that will be discussed later. [...] Where the SHARED KERNEL is a collaboration between two teams that coordinate tightly, CONFORMIST deals with integration with a team that is not interested in collaboration. - 转录说明:原 EPUB 将 `model` 与 `plus` 间的破折号编码为异常字符,并将段首 `CONFORMIST` 拆成 `C ONFORMIST`;上引规范为可读拼写。