malaikuangren

What is the purpose or drive to build thing like (xxx),How can it achieve the original goal of design?

2008年10月31日

Implementing the Singleton Pattern in C#

摘要: 转自:http://www.yoda.arachsys.com/csharp/singleton.htmlThe singleton pattern is one of the best-known patterns in software engineering. Essentially, a singleton is a class which only allows a single instance of itself to be created, and usually gives simple access to that instance. Most commonly, sing 阅读全文

posted @ 2008-10-31 17:02 malaikuangren 阅读(275) 评论(0) 推荐(0) 编辑
C#中静态变量的何时初始化

摘要: 引用自http://blog.csdn.net/dql1982/archive/2007/12/04/1916559.aspx类的静态字段变量初始值设定项对应于一个赋值序列,这些赋值按照它们在相关的类声明中出现的文本顺序执行。如果类中存在静态构造函数则静态字段初始值设定项的执行在该静态构造函数即将执行前发生。否则,静态字段初始值设定项在第一次使用该类的静态字段之前先被执行,但实际执行时间依赖于具体的实现。在以下示例中: usingSystem;classTest...{staticvoidMain()...{Console.WriteLine("{0}{1}",B.Y,A. 阅读全文

posted @ 2008-10-31 16:41 malaikuangren 阅读(2331) 评论(0) 推荐(0) 编辑