← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 2295.f.3.c

层以受控接口提供抽象

理解等级:中级

层是通过受控接口提供一组内聚服务的抽象虚拟机,层间使用权限受到管理。严格分层时一层只使用规定的下一层,可隔离底层平台变化、支持可移植性与渐进开发。关键是允许的依赖规则,而不只是把目录命名为上层下层。

第8章补充:层间允许使用关系须单向;允许跨越相邻层叫层桥接,过多桥接可能削弱移植与修改收益,多层调用也可能增加性能开销。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 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.

    参考来源

    - 位置:《Software Architecture in Practice, 4th Edition》第1章《什么是软件架构》(来源项目:book-sources;源文件:extracted/Software Architecture in Practice, 4th Edition/_epub-src/ch01.html) - 结论依据:原文的定义、机制或比较支持“层是通过受控接口提供一组内聚服务的抽象虚拟机,层间使用权限受到管理”;正文保留其条件与取舍。 - 原始内容: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.