16个设计模式小顾整理.docVIP

  • 0
  • 0
  • 约1.37万字
  • 约 13页
  • 2016-10-03 发布于贵州
  • 举报
16个设计模式小顾整理

面向对象设计原则: 1、单一职责原则(Single Responsibility Principle, SRP) 定义:一个对象应该只包含单一的职责,并且该职责被完整地封装在一个类中。 Every object should have a single responsibility, and that responsibility should be entirely encapsulated by the class. 2、开闭原则(Open-Closed Principle, OCP) 定义:一个软件实体应当对扩展开放,对修改关闭。 Software entities should be open for extension, but closed for modification. 3、里氏代换原则(Liskov Substitution Principle, LSP) 定义:所有引用基类(父类)的地方必须能透明地使用其子类的对象。 Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it. 4、依赖倒转原

文档评论(0)

1亿VIP精品文档

相关文档