摘要:定义 解释器模式(Interpreter Pattern)是一种按照规定语法对表达式进行解析的方案,在项目中较少使用。 英文:Given a language,define a representation for its grammer along with an interpreter that
阅读全文
摘要:定义 状态模式(State Pattern)又称为状态对象模式,该模式允许一个对象在其内部状态改变的时候改变行为。 英文:Allow an object to alert its behavior when its internal state changes.The object will app
阅读全文
摘要:定义 访问者(Visitor Pattern)的目的是封装一些施加于某种数据结构元素之上的操作,即使这些操作需要修改,接收这个操作的数据结构却可以保持不变。 英文原话:Represent an operation to be performed on the elements of an objec
阅读全文
摘要:定义 备忘录模式(Memento Pattern)又称为快照(Snapshot)模式或Token模式。 英文原话:Without violating encapsulation,capture and externalize an object's internal state so that th
阅读全文
摘要:定义 观察者(Observer Pattern)模式也称为发布订阅模式,它是一种在项目中经常使用的模式。 英文原话:Define a one-to-many dependency between objects so that when one object changes state,all it
阅读全文
摘要:定义 中介者模式(Mediator)也称调停者模式,是一种比较简单的模式。 英文:Define an object that encapsulates how a set of objects interact.Mediator promotes loose coupling by keeping
阅读全文
摘要:定义 迭代器模式(Iterator Pattern)是使用率最高的几个模式之一,被广泛地应用到Java的API中。例如:Java的集合(Collection)框架中,就广泛使用迭代器来遍历集合中元素。 英文原话:Provide a way to access the elements of an a
阅读全文
摘要:定义 策略模式(Strategy Pattern)也叫政策模式,是一种比较简单的模式。 英文原话:Define a family of algorithms,encapsulate each one,and make them interchangeable. 翻译:定义一组算法,将每个算法都封装起
阅读全文
摘要:定义 责任链模式(Chain of Responsibility Pattern)是一种常见的行为模式。 责任链模式英文原话是:Avoid coupling the sender of a request to its receiver by giving more than one object
阅读全文
摘要:定义 命令模式(Command Pattern)又称为行动(Action)模式或者交易(Transaction)模式。 英文原话:Encapsulate a request as an object,thereby letting you parameterize clients with diff
阅读全文
摘要:定义 享元模式(Flyweight Pattern)是池技术的重要实现方式,它可以降低大量重复的、细粒度的类在内存中的开销。英文原话是:Use sharing to support large numbers of fine-grained objects efficiently.意思是:使用共享对
阅读全文
摘要:定义 外观模式(Facade Pattern)也叫门面模式,是一种比较常用同时也非常简单的设计模式。英文原话是:Provide a unified interface to a set of interfaces in a subsystem.Facade defines a higher-leve
阅读全文
摘要:定义 桥梁结构(Bridge Pattern)也称桥接模式,是一种简单但不常使用的设计模式。 英文原话是:Decouple an abstraction from its implementation so that the two can vary independently.意思是:将抽象和实现
阅读全文
摘要:定义 组合(Composite Pattern)模式也叫合成模式,用来描述部分与整体的关系。英文原话是:Compose objects into tree structures to represent part-whole hierarchies.Composite lets clients tr
阅读全文
摘要:定义 适配器模式(Adapter Pattern)又叫变压器模式。在适配器模式下,变压器的作用是把一种电压变换为另一种电压。 英文原话是:Convert the interface of a class into another interface clients expect.Adapter le
阅读全文
摘要:定义 装饰模式的英文原话是:Attach additional responsibilities to an object dynamically keeping the same interface.Decorators provide a flexible alternative to subc
阅读全文