摘要: 装饰器模式_weapon = $weapon; } public function cost(){ return $this->_weapon->cost() + $this->_price; } public function descript... 阅读全文
posted @ 2015-04-14 16:15 ikasa007 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 适配器模式'; }}//类适配器模式class Adapter implements Target{ private $adatee; public function __construct(Adatee $adatee){ $this->adatee = $adat... 阅读全文
posted @ 2015-04-14 15:19 ikasa007 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 观察者模式_observers[] = $sub; } //外部统一调用 public function trigger(){ if(!empty($this->_observers)){ ... 阅读全文
posted @ 2015-04-14 14:26 ikasa007 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 策略模式getTrafic(); } } $trafics = new Trafic(); $trafics->useTrafic(new bikeStrategy());?> 阅读全文
posted @ 2015-04-14 10:30 ikasa007 阅读(124) 评论(0) 推荐(0) 编辑