知识卡片
层以受控接口提供抽象
层是通过受控接口提供一组内聚服务的抽象虚拟机,层间使用权限受到管理。严格分层时一层只使用规定的下一层,可隔离底层平台变化、支持可移植性与渐进开发。关键是允许的依赖规则,而不只是把目录命名为上层下层。
第8章补充:层间允许使用关系须单向;允许跨越相邻层叫层桥接,过多桥接可能削弱移植与修改收益,多层调用也可能增加性能开销。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 2 处
- 什么是软件架构 · 查看原书依据
A layer is an abstract “virtual machine” that provides a cohesive set of services through a managed interface. Layers are allowed to use other layers in a managed fashion; in strictly layered systems, a layer is only allowed to use a single other layer. This structure imbues a system with portability—that is, the ability to change the underlying virtual machine.
- 可修改性 · 查看原书依据
In some cases, modules in one layer are required to directly use modules in a nonadjacent lower layer, although normally only next-lower-layer uses are allowed. This case of software in a higher layer using modules in a nonadjacent lower layer is called layer bridging. Upward usages are not allowed in this pattern.