软件的分层设计

分层架构设计模式(Layered Architecture Pattern), 也叫做多层设计模式(n-tier architecture pattern)。

其实分层的方法在实际生活种随处可见:

比如组织架构,村委会 – 县委会 – 市委 – 省委,就是一级一级的汇报和管理关系。

还比如,供应商管理上经常说的 tier-1, tier-2,也是层次关系,从tier-1采购的东西,可能里面零件是从tier-2那里采购的。

还有就是公司内部的业务,也是一层层的推进汇报,比如市场部负责产品可行性研究,之后开发部做出原型并开发成品,然后生产部进行生产。

所以分层架构设计模式,本来就很匹配很多公司里面的传统IT通信和组织架构,就适合很多企业应用。

比如现在很多企业里用的软件应用,都是分为表现层,业务层和数据层,Presentation layer, business logic layer, data access layer。

Architectures have the same objective — the separation of concerns. They all achieve it by dividing the software into layers. — Uncle Bob

Why Divide the Application into Layers

  1. Maintains the Single Responsibility Principle.

  2. Follows Separation of Concerns.

  3. Isolates development roles & skills. (Presentation Layer — FE dev, Business Layer — BE dev)

  4. Supports multiple implementations. (Interchangeable Presentation Layer)

  5. Varying rates of change.

  6. Slices application to more manageable units.

来源:夜流冰

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年5月16日
下一篇 2021年5月16日

相关推荐