![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
设计模式
mumushuiding
这个作者很懒,什么都没留下…
展开
-
设计模式-桥梁模式-Bridge
源码地址:https://github.com/mumushuiding/golang-design-pattern/tree/master/02_Bridge原创 2019-08-23 17:17:15 · 136 阅读 · 0 评论 -
设计模式-策略模式-Strategy
策略模式-Strategy源码:https://github.com/mumushuiding/golang-design-pattern/tree/master/10_strategy❓问题为了把一组不同的算法在应用中相互进行替换。✔️解决方法策略模式把所有可用的策略通过接口 IStrategy 进行抽象化,并把每一个策略封装在一个对象中。⚡️类图...原创 2019-09-11 11:05:44 · 111 阅读 · 0 评论 -
设计模式-观察者模式-Observer
????观察者模式-Observer源码地址:https://github.com/mumushuiding/golang-design-pattern/tree/master/09_Observer❓问题采用观察者模式,当一个对象的状态发生变化时,它会????通知所有依赖它的对象。✔️解决方法一个????可观察对象可以被多个????观察者对象监督。可观察对象在运行时????...原创 2019-09-05 16:02:27 · 153 阅读 · 0 评论 -
设计模式-命令模式-Command
命令模式-Command源码地址:https://github.com/mumushuiding/golang-design-pattern/tree/master/08_Command❓问题命令模式可以把一个命令的形成和执行在时间上去耦。也就是命令生成和执行可以在不同的时间发生。✔️解决方法一个具体命令(execute()/执行)和指向接收对象(Light...原创 2019-09-03 15:34:32 · 239 阅读 · 0 评论 -
设计模式-模板方法模式-TemplateMethod
模板方法模式-TemplateMethod❓问题算法的基本结构应该在基类中确定,在子类中实现可变化部分✔️解决方法模板方法模式用于可分解成单个操作的算法,算法由原创 2019-08-30 18:03:17 · 99 阅读 · 0 评论 -
设计模式-代理模式-Proxy
代理模式-Proxy源码地址:https://github.com/mumushuiding/golang-design-pattern/tree/master/06_Proxy❓问题代理模式是把一个实际存在的对象隐藏在一个与它有相同接口的代理者身后。✔️解决方法代理者包含实际对象的接口,通过实际对象要经过代理⚡️类图原创 2019-08-30 10:45:35 · 130 阅读 · 0 评论 -
设计模式-组合模式-Composite
原创 2019-08-27 15:57:48 · 140 阅读 · 0 评论 -
设计模式-外观模式-Facade
外观模式-Facade源码地址:https://github.com/mumushuiding/golang-design-pattern/tree/master/04_Facade❓问题外观模式是一个简单的、统一的接口,通过这个接口可以使用系统中的类。就好像路由器和网关一样,它对外只提供简单的接口,隐藏内部复杂的相互关系。✔️解决方法外观原创 2019-08-26 18:06:22 · 140 阅读 · 0 评论 -
设计模式-装饰模式-Decorator
原创 2019-08-26 11:58:19 · 112 阅读 · 0 评论 -
设计模式-适配器模式-Adapter
适配器模式-Adapter原文地址:https://github.com/mumushuiding/golang-design-pattern/tree/master/01_Adapter把一个"错误"的接口原创 2019-08-23 11:52:33 · 192 阅读 · 0 评论 -
设计模式-中间者模式-Mediator
中间者模式-Mediator❓问题处在中心位置的中间者应该控制多个对象间的协调工作。对象间的相互合作通过中间者在对象间传递消息实现,以此实现对象间的去耦,提高对象的复用性和系统整体对外的清晰性。✔️解决方法在中间者模式,对象间不是直接互相通信,而是间接地通过中间者。中间者收到消息后,再通知所有相关的对象。⚡️类图????参与者Mediator (中...原创 2019-09-12 17:07:10 · 710 阅读 · 0 评论