baihongyu.com
博客
关于我
设计模式——命令模式
阅读量:
309 次
发布时间:
2019-03-03
本文共 184 字,大约阅读时间需要 1 分钟。
意图:
将一个请求封装为一个对象,从而可以使用不同的请求对客户进行参数化;支持请求排队、记录请求日志,以及撤销操作
场景:
调用者不需要知道响应者具体做了什么,而只需要一个统一的接口时
需要用到队列执行、取消操作、日志恢复的时候
类图:
图片来自《设计模式之禅》
优点:
Command易于通过继承拓展新功能,并且可以在单个子类中实现复合功能
缺点:
容易产生子类爆炸
转载地址:http://jzwm.baihongyu.com/
你可能感兴趣的文章
nginx 配置https(一)—— 自签名证书
查看>>
nginx 配置~~~本身就是一个静态资源的服务器
查看>>
Nginx 配置服务器文件上传与下载
查看>>
Nginx 配置清单(一篇够用)
查看>>
Nginx 配置解析:从基础到高级应用指南
查看>>
Nginx 集成Zipkin服务链路追踪
查看>>
nginx 集群配置方式 静态文件处理
查看>>
nginx+mysql+redis+mongdb+rabbitmq 自动化部署脚本
查看>>
nginx+php的搭建
查看>>
nginx+tomcat+memcached
查看>>
Nginx+Tomcat实现动静分离
查看>>
nginx+Tomcat性能监控
查看>>
nginx+uwsgi+django
查看>>
nginx+vsftp搭建图片服务器
查看>>
Nginx-http-flv-module流媒体服务器搭建+模拟推流+flv.js在前端html和Vue中播放HTTP-FLV视频流
查看>>
nginx-vts + prometheus 监控nginx
查看>>
nginx: [emerg] getpwnam(“www”) failed 错误处理方法
查看>>
nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:
查看>>
nginx:Error ./configure: error: the HTTP rewrite module requires the PCRE library
查看>>
Nginx、HAProxy、LVS
查看>>