知识卡片
开放层允许有条件绕行
开放层允许请求跳过它。原书加入共享服务层时把该层设为开放,使业务层仍可直接访问持久化层;只有需要共享服务的请求才经过服务层。绕行减少无意义转发,但也增加跨层耦合,应明确哪些调用允许跳过、由谁核对依赖规则。
结构图:
flowchart TD
B[业务层] -->|使用共享能力| S[开放的服务层]
S --> P[持久化层]
B -->|无需共享能力| P
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Layered Architecture Style · 查看原书依据
However, you must mark the new Services layer as open; otherwise, the Business layer would be forced to go through the Services layer to access the Persistence layer.
参考来源
- 位置:《Fundamentals of Software Architecture》第13章《Layered Architecture Style》(源文件:`OEBPS/ch10.html`)
- 结论依据:原书以新增 Services 层为例解释开放层及其绕行理由;治理建议为推断。
- 原始内容:However, you must mark the new Services layer as open ; otherwise, the Business layer would be forced to go through the Services layer to access the Persistence layer.