设计模式Design Pattern:

   通过实现“面向对象”的原则,从而达到了代码复用、增强可维护性的目的。使得代码编制真正工程化

一、面向对象的几个原则:

1)开闭原则OCP(OpenClosed Principal)

2)里氏代换原则LSP(LiskovSubstitution Principle)

3)接口隔离原则ISP(InterfceSegregation Principle)

4)依赖倒转原则DIP(DependencyInversion Principle)

5)合成/聚合复用原则CARP(Composite/AggregateReuse Principle)

6)最小知识原则/迪米特法则PLK(Principleof Least Knowledge)

 

二、设计模式分为3种类型(共23类):

1)创建型模式:单例模式、抽象工厂模式、建造者模式、工厂模式、原型模式。

2)结构型模式:适配器模式、桥接模式、装饰模式、组合模式、外观模式、享元模式、代理模式。

3)行为型模式:模版方法模式、命令模式、迭代器模式、观察者模式、中介者模式、备忘录模式、解释器模式、状态模式、策略模式、职责链模式、访问者模式。

 

Thinking In DesignPattern

 

Thinking In DesignPattern

Thinking In DesignPattern

相关文章:

  • 2021-06-16
  • 2021-09-22
  • 2021-10-16
  • 2021-12-10
  • 2022-01-29
  • 2021-06-26
  • 2021-07-19
  • 2021-07-13
猜你喜欢
  • 2021-05-31
  • 2021-11-26
  • 2022-02-02
  • 2021-05-24
  • 2021-08-14
  • 2021-06-27
相关资源
相似解决方案