随笔分类 - 设计模式
摘要:博文原址: "折腾Java设计模式之单例模式" 单例模式 Ensure a class has only one instance, and provide a global point of access to it. 一个类仅仅只有一个实例,并且提供全局的接入点。简洁点理解就是涉及到一个单一的类
阅读全文
摘要:博文原址: "折腾Java设计模式之建造者模式" 建造者模式 Separate the construction of a complex object from its representation, allowing the same construction process to create
阅读全文
摘要:博文原址: "折腾Java设计模式之中介者模式" 中介者模式 中介者模式(Mediator Pattern)是用来降低多个对象和类之间的通信复杂性。这种模式提供了一个中介类,该类通常处理不同类之间的通信,并支持松耦合,使代码易于维护。中介者模式属于行为型模式。 通俗点来讲就是提供一个中介平台,说到平
阅读全文
摘要:原文地址: "折腾Java设计模式之备忘录模式" 备忘录模式 Without violating encapsulation, capture and externalize an object's internal state allowing the object to be restored
阅读全文
摘要:观察者模式 Define a one to many dependency between objects where a state change in one object results in all its dependents being notified and updated auto
阅读全文
摘要:原文地址 "折腾Java设计模式之状态模式" 状态模式 在状态模式(State Pattern)中,类的行为是基于它的状态改变的。这种类型的设计模式属于行为型模式。在状态模式中,我们创建表示各种状态的对象和一个行为随着状态对象改变而改变的 context 对象。通俗点就是一个对象在内部状态发生改变时
阅读全文
摘要:博客原文地址: "折腾Java设计模式之模板方法模式" 模板方法模式 Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template method lets subcl
阅读全文
摘要:设计模式 23种设计模式大纲... "软件设计模式原则" 构建模式 Builder (建造者模式) Abstract Factory (抽象工厂模式) Factory Method (工厂方法) Prototype (原型模式) Singleton (单例模式) 结构模式 Adapter (适配器模
阅读全文
摘要:迭代器模式 Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation. 提供一种不公示其底层细节(结构)的情况下能顺序
阅读全文
摘要:博客原文地址: "折腾Java设计模式之访问者模式" 访问者模式 Represent an operation to be performed on the elements of an object structure. Visitor lets a new operation be define
阅读全文
摘要:博客原文地址 "折腾Java设计模式之命令模式" 命令模式 wiki上的描述 Encapsulate a request as an object, thereby allowing for the parameterization of clients with different request
阅读全文
摘要:"博客原文地址" 简介 在策略模式(Strategy Pattern)中,一个类的行为或其算法可以在运行时更改。这种类型的设计模式属于行为型模式。简单理解就是一组算法,可以互换,再简单点策略就是封装算法。 意图 定义一系列的算法,把它们一个个封装起来, 并且使它们可相互替换。 主要解决 在有多种算法
阅读全文
摘要:解释器模式 解释器模式是类的行为模式。给定一个语言之后,解释器模式可以定义出其文法的一种表示,并同时提供一个解释器。客户端可以使用这个解释器来解释这个语言中的句子。 意图 给定一个语言,定义它的文法表示,并定义一个解释器,这个解释器使用该标识来解释语言中的句子。 主要解决 对于一些固定文法构建一个解
阅读全文
摘要:解释器模式 解释器模式是类的行为模式。给定一个语言之后,解释器模式可以定义出其文法的一种表示,并同时提供一个解释器。客户端可以使用这个解释器来解释这个语言中的句子。 意图 给定一个语言,定义它的文法表示,并定义一个解释器,这个解释器使用该标识来解释语言中的句子。 主要解决 对于一些固定文法构建一个解
阅读全文

浙公网安备 33010602011771号