模式分类
1. 创建型:Creational
Creational patterns involve object instantiation and all provide a way to decouple a client from the objects it needs to instantiate.
创建型模式,涉及到对象的实例化。这个模式提供一个方法,让客户(Client)从所需要实例化的对象中解耦
singleton,builder,prototype,abstract factory,factory method
2. 行为型Behavioral
Any pattern that is a Behavioral Pattern is concerned with how classes and objects interact and distribute responsibility.
类和对象如何交互,以及职责分配
Template method command ,iterator,visitor ,mediator,memento,interpreter,observer,chain of responsibility,state,strategy.
3. 结构型
Structural patterns let you compose classes or objects into larger structures.
组合类和对象,到更大的机构
decorator,proxy, facade,comosite,adptor,bridgy.
还有一种分类方式:
Patterns are often classified by a second attribute: whether or not
the pattern deals with classes or objects:
根据处理类还是对象分