Software Architecture

Layered Systems

软件设计发展

初始状态:硬件

-> 如何提高算法适应性?

-> 分离出了程序(汇编)


发展-操作系统软件

初始状态:硬件 + 程序
程序的共性(稳定)成分: 计算资源管理
产生:操作系统
分离出了:应用程序


发展-数据库软件

初始状态:硬件 + 操作系统 + 应用程序
程序的共性(稳定)成分:数据管理
产生了:数据库管理系统
分离出了:应用软件

发展-中间件软件

初始状态:硬件 + 操作系统 + 数据库管理系统 +应用软件
程序的共性(稳定)成分:资源管理和服务
产生了:中间件(应用服务器)
分离出了:业务逻辑

发展历程

为控制软件复杂度提取软件的共性成份而沉淀下来的一层软件,屏蔽系统低层的复杂度,在高层保持复杂度的相对稳定

分层结构


典型分层设计

网络协议层

共性提取

“公共功能”需求:对网络假设的相同

  • 可靠传输
  • 无失败传输
  • 无错误投递

互联网协议栈设计

核心思想

  • 实现了对复杂问题的分步求解
    • 自顶向下看:不断的假设过程
    • 自底向上看:不断的抽象过程
  • 各层语义良好
    • 具有明确的使用场景
    • 提供良好的复用条件

再例如:Desktop Application

Three layered

  • Data Access Layer is basically the server which stores all the application’s data.
  • Business Logic Layer is mainly working as the bridge between Data Access Layer and Presentation Layer.
  • Presentation Layer is the layer in which the users interact with an application.

Some Bad Examples

ssoad/BankingSystem

janwadolowski/library-management-system

...

阅读材料

《Three Layer Architecture in C# .NET》