知识卡片
外部集成按依赖形态选边界
对遗留或外部系统先确认是否真要程序级集成;只需让用户分别访问两个系统时,可走[[没有运行时依赖可分开建模]]。确需集成时,选择取决于新功能与旧模型的关系:
| 情况 | 选择与代价 |
|---|---|
| 新功能只是旧系统的外围扩展、接口很大 | 可[[顺从上游模型换取集成简化]];按旧模型扩展,放弃自行修改它 |
| 新系统功能更独立、接口较小,或旧模型很差 | 保留自己的上下文,用翻译层或[[防腐层隔离外部模型语义]] |
这是一组原书的条件性建议,不保证任一方案的实施结果。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第14章|Choosing Your Model Context Strategy · 查看原书依据
When the functionality of the system under design is going to be more involved than an extension to an existing system, where your interface to the other system is small, or where the other system is very badly designed, you'll really want your own BOUNDED CONTEXT, which means building a translation layer, or even an ANTICORRUPTION LAYER.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第114章《Choosing Your Model Context Strategy》(源文件:_epub-src/0321125215_ch14lev1sec13.html;单元02)
- 结论依据:原文从 Separate Ways 讲起,再按外围扩展、接口大小、新功能独立性与旧系统质量比较 Conformist 和 Anticorruption Layer。
- 原始内容:There are three patterns that can apply here. First, to consider SEPARATE WAYS. [...] Would it be sufficient to give the user easy access to both systems? Integration is expensive and distracting, so unburden your project as much as you can. If the integration is really essential, you can choose between two extremes: CONFORMIST or ANTICORRUPTION LAYER. [...] However, sticking with the legacy model may be appropriate in the case of peripheral extensions to a large system that will continue to be the dominant system. [...] If your application is really an extension to the existing system and your interface with that system is going to be large, the translation between CONTEXTS can easily be a bigger job than the application functionality itself. [...] If you decide on a CONFORMIST design, you must do it wholeheartedly. You restrict yourself to extension only, with no modification of the existing model. When the functionality of the system under design is going to be more involved than an extension to an existing system, where your interface to the other system is small, or where the other system is very badly designed, you'll really want your own BOUNDED CONTEXT, which means building a translation layer, or even an ANTICORRUPTION LAYER.
- 转录说明:`[...]` 标明各处实际略去的判断和示例;原 EPUB 强调标签边界造成的术语前空格已规范转录。