设计模式概述
2014-03-08 16:14
239 查看
设计模式(Design Pattern)是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结,使用设计模式是为了可重用代码、让代码更容易被他人理解并且保证代码可靠性。
狭义的设计模式是指GoF在《设计模式:可复用面向对象软件的基础》一书中所介绍的23种经典设计模式,不过设计模式并不仅仅只有这23种,随着软件开发技术的发展,越来越多的新模式不断诞生并得以应用。
设计模式可分为创建型(Creational),结构型(Structural)和行为型(Behavioral)三种。
创建型模式主要用于描述如何创建对象,结构型模式主要用于描述如何实现类或对象的组合,行为型模式主要用于描述类或对象怎样交互以及怎样分配职责。
转载自:blog.csdn.net/lovelion/article/details/7420863
狭义的设计模式是指GoF在《设计模式:可复用面向对象软件的基础》一书中所介绍的23种经典设计模式,不过设计模式并不仅仅只有这23种,随着软件开发技术的发展,越来越多的新模式不断诞生并得以应用。
设计模式可分为创建型(Creational),结构型(Structural)和行为型(Behavioral)三种。
创建型模式主要用于描述如何创建对象,结构型模式主要用于描述如何实现类或对象的组合,行为型模式主要用于描述类或对象怎样交互以及怎样分配职责。
类型 | 模式名称 | 学习难度 | 使用频率 |
创建型模式 Creational Pattern | 单例模式 Singleton Pattern | ★☆☆☆☆ | ★★★★☆ |
简单工厂模式 Simple Factory Pattern | ★★☆☆☆ | ★★★☆☆ | |
工厂方法模式 Factory Method Pattern | ★★☆☆☆ | ★★★★★ | |
抽象工厂模式 Abstract Factory Pattern | ★★★★☆ | ★★★★★ | |
原型模式 Prototype Pattern | ★★★☆☆ | ★★★☆☆ | |
建造者模式 Builder Pattern | ★★★★☆ | ★★☆☆☆ | |
结构型模式 Structural Pattern | 适配器模式 Adapter Pattern | ★★☆☆☆ | ★★★★☆ |
桥接模式 Bridge Pattern | ★★★☆☆ | ★★★☆☆ | |
组合模式 Composite Pattern | ★★★☆☆ | ★★★★☆ | |
装饰模式 Decorator Pattern | ★★★☆☆ | ★★★☆☆ | |
外观模式 Façade Pattern | ★☆☆☆☆ | ★★★★★ | |
享元模式 Flyweight Pattern | ★★★★☆ | ★☆☆☆☆ | |
代理模式 Proxy Pattern | ★★★☆☆ | ★★★★☆ | |
行为型模式 Behavioral Pattern | 职责链模式 Chain of Responsibility Pattern | ★★★☆☆ | ★★☆☆☆ |
命令模式 Command Pattern | ★★★☆☆ | ★★★★☆ | |
解释器模式 Interpreter Pattern | ★★★★★ | ★☆☆☆☆ | |
迭代器模式 Iterator Pattern | ★★★☆☆ | ★★★★★ | |
中介者模式 Mediator Pattern | ★★★☆☆ | ★★☆☆☆ | |
备忘录模式 Memento Pattern | ★★☆☆☆ | ★★☆☆☆ | |
观察者模式 Observer Pattern | ★★★☆☆ | ★★★★★ | |
状态模式 State Pattern | ★★★☆☆ | ★★★☆☆ | |
策略模式 Strategy Pattern | ★☆☆☆☆ | ★★★★☆ | |
模板方法模式 Template Method Pattern | ★★☆☆☆ | ★★★☆☆ | |
访问者模式 Visitor Pattern | ★★★★☆ | ★☆☆☆☆ |
相关文章推荐
- 微信存在的理由
- Poj2296
- 在Linux下用C语言操作数据库sqlite3(建立数据库)
- 科技改变生活,阵痛在所难免
- 免安装版MYSQL在直接删除DATA文件夹下的数据后报错1067
- 康乃馨花语
- 环境变量添加
- (libgdx小结)游戏摇杆
- 跨部门沟通技巧有哪些?
- Java就业培训教程
- 大小写互换
- core java 14.3
- 《大话设计模式》--总结(一)
- 关于hashcode在不同的jvm不同的问题
- archlinux pacman 命令
- 文学书籍 手机格式 2014.02.23
- 文学 书籍 手机格式2014.02.23
- 开灯问题
- 1的个数
- javaweb之request使用RequestDispatcher的include方法实现页面包含