接口 强内聚 松耦合 单一职责原则
李智慧
大型网站架构技术一览
服务器架构
“
大型网站由于服务器采购规模庞大,打地铺采用定制服务器的方式代替购买服务器整机。根据网站应用需求,定制硬盘、内存,甚至CPU,同时去除不必要的外设接口(显示器输出接口,鼠标、键盘接口),并使空间结构利于散热。
”
面向对象
0-可维护
1-可扩展
2-可复用
3-灵活性好
“可以把PC理解成大的软件系统,任何部件如CPU、内存、硬盘、显卡等都可以理解为程序中封装的类或程序集,
由于PC易插拔的方式,那么不管那一个出问题,都可以在不影响别的部件的前提下进行修改或替换。”
PC电脑<--->易插拔
面向对象<--->强内聚、松耦合
程杰
会修电脑不会修收音机?——依赖倒转原则
PC的接口是有限的,所以扩展有限。软件系统设计得好,就可以无限地扩展。
The Single Reponsibility Principle
Single responsibility principle - Wikipedia https://en.wikipedia.org/wiki/Single_responsibility_principle
The single responsibility principle is a computer programming principle that states that every module or class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility. Robert C. Martin expresses the principle as, "A class should have only one reason to change."[1]
把因相同原因而变化的东西聚合到一起,而把不同原因而变化的东西分离开来
设计模式 | 菜鸟教程 https://www.runoob.com/design-pattern/design-pattern-tutorial.html