设计模式:建造者模式

建造者模式(Builder Pattern)也叫做生成器模式,其定义如下:
Separate the construction of a complex object from its representation so that the same construction process can create different representations.
将一个复杂对象的构建与它的表示分离,使得同样的构建过程可以创建不同的表示.

阅读更多

设计模式之模版方法模式

模板方法模式的定义

定义一个操作中的算法的框架,而将一些步骤延迟到子类中。使得子类可以不改
变一个算法的结构即可重定义该算法的某些特定步骤

Define the skeleton of an algorithm in an operation,deferring some steps to subclasses.Template
Method lets subclasses redefine certain steps of an algorithm without changing the algorithm’s
structure

阅读更多

设计模式之工厂模式

Define an interface for creating an object, but let subclass decide which class to instantiate, Factory Method lets a class defer instantiation to subclass.

定义一个创建对象的接口,让子类决定实例化那一个类,工厂方法是一个类的实例化延迟到子类。

阅读更多