Software Design Principle
来源:互联网 发布:配乐朗诵软件 编辑:程序博客网 时间:2024/05/17 06:58
Program to an interface, not an implementation.
--我可以修改实现却不会影响客户端使用;--客户端可以根据实际需要对实现进行扩展从而满足不同的需求。- Favor object composition over class inheritance.
首先要理解为什么这些原则是正确的,然后才理解如何实现它们。
--实际情况下下用composition还是inhertiance还是很好区分的。通常核心类都会采用继承来满足不同的需求,软件功能的完成通过核心类的交互来实现。而最外层提供给客户端使用的对象通常采用composition将核心类包装起来,这样客户端不需要知道具体的实现,只需知道组件提供的接口即可。
3. TheOpen/Closed Principle
--如何实现?In practical terms, this means either using composition or perhaps safe-and-cleanclass inheritance。
4. Liskov'sSubstitution Principle
--不是任意的子类都可以替换父类的,比如父类的虚拟方法访问了私有变量就会造成父类与子类不可替换。
--在代码内部违反这一原则对调用者而言就违反了OCP原则。
5. TheDependency Inversion Principle
- Some Software Design Principle
- Software Design Principle
- 《Agile Software Development》关于Design Principle阅读笔记
- design principle
- Design Principle
- OO Design Principle Notes
- Power design principle
- Software Design
- Software Design
- agsXMPP Software Design
- Software Modeling and Design
- Embeded Software Design
- Embedded Software Design Engineer
- What is Software Design?
- Software Design Specification Templates
- Software design pattern
- 《Software Design中文版01》
- Principles of Software Design
- 二元查找树-- 在二元树中找到和为某一值的所有路径
- IAR编译选项的位置
- Tomcat内存 jvm内存分配
- Ubuntu 出现apt-get: Package has no installation candidate问题
- android控件08 CheckBox
- Software Design Principle
- iphone相关
- path效果
- 云计算之路:迷惑在前 务必要务实求真
- virtual关键字用法总结
- 关于在apache里面给php写虚拟目录的问题详细方法
- SD卡FAT32文件系统调试笔记
- Android APK反编译
- Maven的生命周期、生命周期阶段、打包类型、目标