知识卡片
插件契约应隔离个性化格式
同一领域的插件宜共享行为、输入和输出契约,使核心可用同一调用方式替换插件。若第三方插件只能提供不同格式,可用适配器把其契约转换为核心的标准契约,避免核心为每个插件写特例。设备评估接口与报告字段是原书示例;核心只需传递或展示报告,不必理解报告的内部格式。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Microkernel Architecture Style · 查看原书依据
In such cases, it is common to create an adapter between the plug-in contract and your standard contract so that the core system doesn’t need specialized code for each plug-in.
参考来源
- 位置:《Fundamentals of Software Architecture》原书第13章《Microkernel Architecture Style》(阅读计划第16项;源文件:`OEBPS/ch13.html`)
- 结论依据:原文说明标准契约、第三方定制契约和适配器的作用,并以评估报告说明职责边界。
- 原始内容:In such cases, it is common to create an adapter between the plug-in contract and your standard contract so that the core system doesn’t need specialized code for each plug-in.