WHB1 / WHB1.github.io.old

blog
0 stars 0 forks source link

GOF 23种 设计模式 #28

Open WHB1 opened 6 years ago

WHB1 commented 6 years ago

Gang of Four【GOF】:四人组

《Design Patterns: Elements of Reusable Object-Oriented Software》 【《设计模式》】 由 Erich Gamma、Richard Helm、Ralph Johnson 和 John Vlissides 合著(Addison-Wesley,1995)
这几位作者常被称为"四人组(Gang of Four)"

联系JavaScript设计模式

https://github.com/WHB1/WHB1.github.io/issues/14

WHB1 commented 6 years ago

23种 设计模式

http://blog.csdn.net/zhangcanyan/article/details/51778828

创建型

  1. Factory Method(工厂方法)
  2. Abstract Factory(抽象工厂)
  3. Builder(建造者)
  4. Prototype(原型)
  5. Singleton(单例)

结构型

  1. Adapter Class/Object(适配器)
  2. Bridge(桥接)
  3. Composite(组合)
  4. Decorator(装饰)
  5. Facade(外观)
  6. Flyweight(享元)
  7. Proxy(代理)

行为型

  1. Interpreter(解释器)
  2. Template Method(模板方法)
  3. Chain of Responsibility(责任链)
  4. Command(命令)
  5. Iterator(迭代器)
  6. Mediator(中介者)
  7. Memento(备忘录)
  8. Observer(观察者)
  9. State(状态)
  10. Strategy(策略)
  11. Visitor(访问者)

57a92d42-4d84-3aa9-a8b9-63a0b02c2c36


二、设计模式的六大原则

1、开闭原则(Open Close Principle) 2、里氏代换原则(Liskov Substitution Principle) 3、依赖倒转原则(Dependence Inversion Principle) 4、接口隔离原则(Interface Segregation Principle) 5、迪米特法则(最少知道原则)(Demeter Principle) 6、合成复用原则(Composite Reuse Principle)


三、Java的23中设计模式
并且参考
http://blog.csdn.net/defineshan/article/details/52547265