知识卡片
抽象核心过早冻结会阻碍模型深化
可插拔组件框架要求接口精确,且核心模型足够深入,能表达必要行为。应用只能在抽象核心允许的范围内变化;若要改变核心协议,就会影响所有依赖组件,核心领域的持续重构可能被迫停滞。
因此原书把它放在多个专门应用充分发展之后考虑,而非项目初期优先采用的大型结构。框架成熟度取决于领域理解,不只取决于插件技术是否可用。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第16章|Pluggable Component Framework · 查看原书依据
Developers can specialize the model, but they can't change the ABSTRACT CORE without changing the protocol of all the diverse components.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第132章《Pluggable Component Framework》(源文件:_epub-src/0321125215_ch16lev1sec5.html)
- 结论依据:原文直接列出接口设计难、应用选择受限、核心重构受阻和多个应用之后再采用的条件。
- 原始内容:Opportunities arise in a very mature model that is deep and distilled. A PLUGGABLE COMPONENT FRAMEWORK usually only comes into play after a few applications have already been implemented in the same domain. [...] There are a few downsides to a PLUGGABLE COMPONENT FRAMEWORK. One is that this is a very difficult pattern to apply. It requires precision in the design of the interfaces and a deep enough model to capture the necessary behavior in the ABSTRACT CORE. Another major downside is that applications have limited options. If an application needs a very different approach to the CORE DOMAIN, the structure will get in the way. Developers can specialize the model, but they can't change the ABSTRACT CORE without changing the protocol of all the diverse components. As a result, the process of continuous refinement of the CORE, refactoring toward deeper insight, is more or less frozen in its tracks.
- 转录说明:`[...]` 标明本节先述适用成熟度、后述代价两段之间的省略;原卡术语前后多余空格来自 EPUB 强调标签边界,已按可读正文规范转录。