设计模式总结

1. Adapter,适配器,

Wraps an object and provides a different interface to it.

适配一个对象,然后提供一个别的接口

 

2. Template method

Subclasses decide how to implement steps in an algorithm.

子类决定怎么实现算法步骤

3. 工厂方法 Factory Method
Subclasses decide which concrete classes to create.

子类决定创建哪个具体类的对象

4.单例模式 Singleton
Ensures one and only object is created.

保证只有一个对象创建

5. 策略模式
Encapsulates interchangeable behaviors and uses delegation to decide which one to use.

封装可变的行为,用一个委托去决定用哪个

6. 组合模式Composite
Clients treat collections of objects and individual objects uniformly.

调用端用同一的方式对待一个对象和一组对象。

7. 状态模式State
Encapsulates state-based behaviors and uses delegation to switch between behaviors.

包装跟状态有关的行为,并且根据状态切换。

8. 迭代器模式 Iterator

Provides a way to traverse a collection of objects without exposing its implementation.

提供一个访问集合的方式,而不用了解他们具体的形式

9. 外观模式Facade
Simplifies the interface of a set of classes.

为一对类提供一个简化接口

10. 装饰者模式
Wraps an object to provide new behavior.

每次包装一个对象,提供新的行为。

11. 抽象工厂
Allows a client to create families of objects without specifying their concrete classes.

创建一组相关的类,这组类息息相关。

12. 观察者模式Observer
Allows objects to be notified when state changes.

每次状态改变,通知其他对象

13.代理模式Porxy

包装一个对象,控制对他的访问
Wraps an object to control access to it.

14. 命令模式,Command
Encapsulates a request as an object

封装调用,成一个对象。

转载于:https://www.cnblogs.com/shenfengok/p/6887791.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值