摘要: loginNum = rand(1,10); $this->hobby = $hobby; $this->observers = new SplObjectStorage(); } public function attach(SplObserver $obs... 阅读全文
posted @ 2015-01-11 20:08 shenming 阅读(147) 评论(0) 推荐(0) 编辑
摘要: <?phpclass Single{ public static $instance = null; //防止子类扩大权限,使外部可以new对象 final protected function __construct(){ } public static functi... 阅读全文
posted @ 2015-01-11 16:45 shenming 阅读(100) 评论(0) 推荐(0) 编辑
摘要: createDB();$db->conn();$facroty = new OracleFactory();$db = $facroty->createDB();$db->conn();实现了对象修改是封闭,对于扩展是开放。 阅读全文
posted @ 2015-01-11 16:17 shenming 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 什么是设计模式典型场景的典型解决方案常见设计模式1.工厂模式2.单例模式3.观察者模式4.责任链模式5.策略模式6.装饰模式7.适配器模式8.桥接模式 阅读全文
posted @ 2015-01-11 15:22 shenming 阅读(112) 评论(0) 推荐(0) 编辑