设计模式笔记1:单件模式
摘要:单件模式(Singleton Pattern)定义确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例。双重锁定 1 public sealed class Singleton 2 { 3 static Singleton instance = null; 4 static readonly object padlock = new object(); 5 6 Singleton() { } 7 8 public static Singleton Instance 9 {10 ...
阅读全文
posted @ 2013-05-26 15:11
浙公网安备 33010602011771号