摘要:
定义 解释器模式(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 阅读全文