摘要:
装饰器模式_weapon = $weapon; } public function cost(){ return $this->_weapon->cost() + $this->_price; } public function descript... 阅读全文
摘要:
适配器模式'; }}//类适配器模式class Adapter implements Target{ private $adatee; public function __construct(Adatee $adatee){ $this->adatee = $adat... 阅读全文
摘要:
观察者模式_observers[] = $sub; } //外部统一调用 public function trigger(){ if(!empty($this->_observers)){ ... 阅读全文
摘要:
策略模式getTrafic(); } } $trafics = new Trafic(); $trafics->useTrafic(new bikeStrategy());?> 阅读全文