Skip to content

WarZhan/DesignPatterns

Repository files navigation

DesignPatterns

设计模式

概述:https://blog.csdn.net/zhanxi1992/article/details/123020040

一、简单工厂模式

源码:FactoryPattern
博文:https://blog.csdn.net/zhanxi1992/article/details/123022083
简单工厂模式

二、工厂方法模式

源码:FactoryMethodPattern
博文:https://blog.csdn.net/zhanxi1992/article/details/123022459
工厂方法模式

三、抽象工厂模式

源码:AbstractFactoryPattern
博文:https://blog.csdn.net/zhanxi1992/article/details/123029805
抽象工厂模式

四、单例模式

源码:SingletonPattern
博文:https://blog.csdn.net/zhanxi1992/article/details/123030569
单例模式

五、MVC 模式

源码:MVCPattern
博文:https://blog.csdn.net/zhanxi1992/article/details/123080793
MVC模式

六、观察者模式

源码:ObserverPattern
博文:https://blog.csdn.net/zhanxi1992/article/details/123124367
观察者模式

七、事件监听模式

源码:EventListenerPattern
博文:https://blog.csdn.net/zhanxi1992/article/details/123152019
事件监听模式

八、代理模式

源码:ProxyPattern
博文:https://blog.csdn.net/zhanxi1992/article/details/123156825
代理模式

X、命令模式

命令模式
将一个请求封装为一个对象,从而可用不同的请求对客户进行参数化,对请求进行排队或记录请求日志,以及支持可撤销的操作。命令模式把请求对象与执行对象分割开

  1. 它能较容易设计一个命令队列
  2. 在需要的情况下,可以较容易的将命令记入日志
  3. 允许接收请求的一方决定是否要执行请求
  4. 可以容易的实现对请求的撤销和重做
  5. 易拓展新的具体命令不影响其他类

参考代码:CommandPatternCommandPatternExample

About

设计模式

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages