设计模式简介

1、概念:面向对象的设计模式是对被用来在特定场景下解决一般设计问题的和相互通信的对象的描述。

 

2、一般而言,一个模式有四个基本要素:

(1)模式名称(pattern name)

(2)问题(problem)

(3)解决方案(solution)

(4)效果(consequences)

 

3、设计模式分类

23种设计模式分类如下:

创建型 结构型 行为型

Factory Method

Abstract Factory

Builder

Prototype

Singleton(单例模式)

Adapter

Bridge

Composite

Decorator

Facade

Flyweight

Proxy

Intepreter

Template Method

Chain of Responsibility

Command

Iterator

Mediator

Memento

Observer

State

Strategy

Vistor

posted on 2019-05-19 14:38  逍遥1989  阅读(114)  评论(0)    收藏  举报