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