摘要:
中介者模式 中介者模式定义:用一个中介对象封装一系列对象交互,中介者使各对象不需要显示地相互作用,从而使其耦合松散,而且可以独立地改变他们之间的交互(Define an object that encapsulates how a set of objects interact. Mediator 阅读全文
摘要:
原型模式 原型模式:用原型实例指定创建对象的种类,并且通过拷贝原型创建新的对象(Specify the kinds of objects to create using a prototypical instance, and create objects by copying this proto 阅读全文
摘要:
代理模式 代理模式:也被称为委托模式,为其他对象提供一种代理以控制对这个对象的访问(Provide a surrogate or placeholder for another object to control access to it)。 代理模式的通用类图中包含三种角色,抽象主体角色(Subj 阅读全文
摘要:
建造者模式 建造者模式:也叫作生成器模式,将一个复杂对象的创建与它的表示分离,使得同样的构建过程可以创建不同的表示(Separate the construction of a complex object from its representation so that the same const 阅读全文
摘要:
模板方法模式 模板方法模式:定义一个算法中的操作框架,而将一些步骤延迟到子类中。使得子类可以不改变算法的结构即可重定义该算法的某些特定步骤。(Define the skeleton of an algorithm in an operation, deferring some steps to su 阅读全文
摘要:
抽象工厂模式 抽象工厂模式:为创建一组相关或相互依赖的对象提供一个接口,而且无需指定他们的具体类。(Provide an interface for creating families of related or dependent objects without specifying their 阅读全文
摘要:
工厂方法模式 工厂方法模式:定义一个用于创建对象的接口,让子类决定实例化哪一个类。工厂方法使一个类的实例化延迟到其子类。(Define an interface for creating an object, but let subclasses decide which class to inst 阅读全文
摘要:
单例模式 单例模式是一个比较简单的模式,其定义如下: 单例模式是一个比较简单的模式,其定义如下: 确保每个类只有一个实例,并且本类实例化对象提供给整个系统(Ensure a class has only one instance, and provide a global point of acce 阅读全文