CSDN博客

img CarlHui

一些面向对象的设计法则

发表于2004/12/29 13:45:00  891人阅读

分类: ALL

一些面向对象的设计法则
  • Favor Composition Over Inheritance,优先使用(对象)组合,而非(类)继承
  • Program To An Interface, Not An Implementation ,针对接口编程,而非(接口的)实现
  • Software Entities Should Be Open For Extension, Yet Closed For Modification,开放-封闭法则(OCP)
  • Function Thar Use Referennces To Base(Super) Classes Must Be Able To Use Objects Of Derived(Sub) Classes Without Knowing It ,Liskov替换法则(LSP)
0 0

相关博文

我的热门文章

img
取 消
img即使是一小步
也想与你分享
打开
img