---
title: "一、设计模式一览"
author: "software_developer"
date: "2013-07-10T00:12:47Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2013-07-10T00:12:46Z"
id: 1902276
url: "https://software-developer.iteye.com/blog/1902276"
---

**设计模式分为三大类：**

A，创建模式（Creational Pattern）：是对类的实例化过程的抽象化。

B，结构模式(Structural Pattern)：描述如何将类或对象结合在一起形成更大的结构。

C，行为模式(Behavioral Pattern)：对不同对象之间划分责任和算法的抽象化。

 

**一、创建模式（5种）**

1，简单工厂（Simple Factory）模式

2，工厂方法（Factory Method）模式

3，抽象工厂（Abstract Factory）模式

4，单例（Singleton）模式

5，多例（Multition）模式

6，建造（Builder）模式

7，原型模式（Prototype）模式

 

**二、结构模式（7种）**

1，适配器（Adapter）模式

2，缺省适配器（Default Adapter）模式

3，合成（Composite）模式

4，装饰（Decorator）模式

5，代理（Proxy）模式

6，享元（Flyweight）模式

7，门面（Facade）模式

8，桥梁（Bridge）模式

 

**三、行为模式（11种）**

1，不变（Immutable）模式

2，策略（Strategy）模式

3，模版方法（Template Method）模式

4，观察者（Observer）模式

5，迭代子（Iterator）模式

6，责任链（Chain of Responsibility）模式

7，命令（Command）模式

8，备忘录（Memento）模式

9，状态（State）模式

10，访问者（Visitor）模式

11，解释器（Interpreter）模式

12，调停者（Mediator）模式

 

上面写了27种设计模式，与我们平时所说的23种设计模式相冲突，是由于有4种模式是其它模式的派生或变体，上面用红色标示的23种模式不包括在23种设计模式中。