摘要: 单例模式(Singleton Pattern)是一个比较简单的模式:确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例实例代码:class Singleton{ private static $singleton = NULL ; private static $count = 0; public static function getInstance(){ if (empty(self::$singleton)){ self::$singleton = new Singleton(); self::$count =+1; } return self::$sin... 阅读全文
posted @ 2013-03-11 21:11 Linux、Mongo、Php、Shell、Python、C 阅读(203) 评论(0) 推荐(0) 编辑