GOF23种设计模式类型、描述和类图(下)


适配器模式
类型: 结构
描述: 将一个类的接口变换成客户端锁期待的另一种接口,从而是原本因接口欧不匹配而无法再一起工作的两个类能够在一起工作。
英文描述:
Convert the interface of a class into another interface clients expect.Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
类图:

组合模式
类型: 结构
描述: 将对象组合成树形结构以表示“部分-整体”的层次结构,使得用户对单个对象和组合对象的使用具有一致性。
英文描述:
Compose objects into tree structures to represent part-whole hierarchies.Composite lets clients treat individual object and compositions of objects uniformly.
类图:

代理模式
类型: 结构
描述: 为其他对象提供一种代理以控制对这个对象的访问。
英文描述:
Provide a surrogate or placeholder for another object to control access to it.
类图:
