随笔分类 - 设计模式
模式就是一种思维方式,是一种在实践中经过检验的行为方式。
摘要:一个经典实例 - 排序 自定义类Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2 3namespace Gof.Test.TemplateMethod 4{ 5 public class User 6 {...
阅读全文
摘要:UICode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Drawing; 3using System.IO; 4using System.Reflection; 5using Syste...
阅读全文
摘要:GirlFactoryCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1using System;23namespace Gof.Test.AbstractFactory4{5 public abstract class GirlFactory ...
阅读全文
摘要:客户代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using Gof.Test.Factory.Machines; 3 4namespace Gof.Test.Factory.Plan 5{ 6 pub...
阅读全文
摘要:IChemicalCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2 3namespace Gof.Test.Flyweight 4{ 5 public interface IChemical 6 { 7 ...
阅读全文
摘要:客户代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1 Console.WriteLine( root.Responsible.Name );2 Console.WriteLine( leafonelef...
阅读全文
摘要:自定义代理类Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Data; 3 4namespace DataLayer 5{ 6 /**//// 7 /// This...
阅读全文
摘要:Machine类(可以包含容器)Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2 3namespace Gof.Test.Mediator 4{ 5 public class Machine 6 { 7 ...
阅读全文
摘要:操作上的抽象Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1using System;23namespace Gof.Test.Bridge4{5 public interface ITankAction6 {7 strin...
阅读全文
摘要:MyFileCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2 3namespace Gof.Test.Composite 4{ 5 public class MyFile:FolderAbstract 6 ...
阅读全文
摘要:外观模式封装系统的复杂性来提高程序的可用性,我们经常用的是数据访问外观类,它隔离了Ado.net的复杂性。 简单的外观例子Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Data; 3usin...
阅读全文
摘要:类适配器: 客户程序定义好的接口Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1using System;23namespace Gof.Test.adapter4{5 public interface ICart6 {7 ...
阅读全文
摘要:InterestingCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 public class Interesting 2 { 3 public ChangeHandler _change; 4 publi...
阅读全文
摘要:SingleTon类Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace Gof.Nan....
阅读全文
摘要:http://www.microsoft.com/china/msdn/library/architecture/architecture/architecturetopic/MVP.mspx?mfr=true主要思想是把以前的View依赖于Bll反转,并把View中的相关控件对象进行抽象。实现后如下:我整理的例子的类之间的关系:/Files/nanshouyong326/MVP.rar 还有几点...
阅读全文

浙公网安备 33010602011771号