许明会的计算机技术主页

Language:C,C++,.NET Framework(C#)
Thinking:Design Pattern,Algorithm,WPF,Windows Internals
Database:SQLServer,Oracle,MySQL,PostSQL
IT:MCITP,Exchange,Lync,Virtualization,CCNP

导航

2007年12月30日

C#设计模式(2):工厂模式

摘要: 简单工厂模式:从抽象类派生多个类型,在工厂类里面通过静态方法产生对象的实例 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->/*--===------------------------------------------===--- 简单工... 阅读全文

posted @ 2007-12-30 12:04 许明会 阅读(290) 评论(0) 推荐(0)

C#设计模式:Singleton模式

摘要: 如何保证一个类只能有一个实例存在? 在多线程情况下如何解决?Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->usingSystem;usingSystem.Collections.Generic;usingSystem.Text;namespaceSingleton{classSingleton{//构造函数私有化,保证不被显式实例化privateSingleton(){}//定义属性,返回Singleton对象privatestaticSi 阅读全文

posted @ 2007-12-30 12:01 许明会 阅读(224) 评论(0) 推荐(0)