[php]php设计模式 Command(命令模式)

摘要: 1 <?php 2 /** 3 * 命令模式 4 * 5 * 将一个请求封装为一个对象从而使你可用不同的请求对客户进行参数化,对请求排除或记录请求日志,以及支持可取消的操作 6 */ 7 interface Command 8 { 9 publicfunction execute(); 10 } 11 12 class Invoker 13 { 14 private$_command=array(); 15 publicfunction setCommand($command) { 16 $this->_command[] =$command; 17 } 18... 阅读全文
posted @ 2011-06-16 00:32 bluefrog 阅读(1592) 评论(2) 推荐(0)