摘要: <?phpclass Preferences { private static $instance; private function __construct() { } public static function getInstance() { if (empty... 阅读全文
posted @ 2015-09-04 16:21 wy0314 阅读(90) 评论(0) 推荐(0)
摘要: units, true)) { return ; } $this->units[] = $unit; } public function remove_unit(Unit $unit) { $this->units = ar... 阅读全文
posted @ 2015-09-04 15:50 wy0314 阅读(153) 评论(0) 推荐(0)
摘要: state = $value; } } public function __get($param) { if ($param == 'state') { return $this->state; } } publ... 阅读全文
posted @ 2015-09-02 21:00 wy0314 阅读(122) 评论(0) 推荐(0)
摘要: _adaptee = new Adaptee(); } public function request() { $this->_adaptee->special_request(); }}$target = new Adapter();$target->request... 阅读全文
posted @ 2015-09-02 16:44 wy0314 阅读(113) 评论(0) 推荐(0)
摘要: "; $context->state = new Concrete_state_B(); }}class Concrete_state_B extends State { public function handle(Context $context) { e... 阅读全文
posted @ 2015-09-01 19:23 wy0314 阅读(166) 评论(0) 推荐(0)
摘要: _name = $name; } public function __get($name) { if ($name == '_name') { return $this->_name; } } public function ... 阅读全文
posted @ 2015-09-01 14:46 wy0314 阅读(135) 评论(0) 推荐(0)
摘要: _observers[] = $observer; } public function detach(Observer $observer) { if (isset($this->_observers[$observer])) { unset($thi... 阅读全文
posted @ 2015-08-31 21:06 wy0314 阅读(173) 评论(0) 推荐(0)
摘要: _parts[] = $part; } public function show() { echo "\n PRODUCT CREATEING..."; foreach ($this->_parts as $part) { echo $p... 阅读全文
posted @ 2015-08-31 15:59 wy0314 阅读(108) 评论(0) 推荐(0)
摘要: "; }}class Sub_system_two { public function method_two() { echo "subsystem one method two"; }}class Sub_system_three { public funct... 阅读全文
posted @ 2015-08-30 16:45 wy0314 阅读(485) 评论(0) 推荐(0)
摘要: "; $this->primitive_operation1(); $this->primitive_operation2(); }}class Concrete_class_A extends Abstract_class { public function... 阅读全文
posted @ 2015-08-30 15:51 wy0314 阅读(400) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示