随笔分类 -  3 Design Pattern

单例模式Singleton Pattern
摘要:用来创建独一无二的,只能有一个实例的对象。Ensure a class has only one instance and provide a global point of access to it.有些对象我们只需要一个实例,例如线程池、缓存、处理偏好设置和注册表对象、日志对象、充当打印机、显卡等设备的驱动程序对象。如果制造出多个实例,就会导致许多问题产生,例如:程序的行为异常、资源使用过量,... 阅读全文

posted @ 2010-07-07 13:14 NewSunshineLife 阅读(185) 评论(0) 推荐(0)

导航