随笔分类 -  设计模式

模式就是一种思维方式,是一种在实践中经过检验的行为方式。
摘要:一个经典实例 - 排序 自定义类Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2 3namespace Gof.Test.TemplateMethod 4{ 5 public class User 6 {... 阅读全文
posted @ 2007-01-10 13:13 南守拥 阅读(241) 评论(1) 推荐(0)
摘要:UICode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Drawing; 3using System.IO; 4using System.Reflection; 5using Syste... 阅读全文
posted @ 2007-01-10 11:27 南守拥 阅读(382) 评论(1) 推荐(0)
摘要:GirlFactoryCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1using System;23namespace Gof.Test.AbstractFactory4{5 public abstract class GirlFactory ... 阅读全文
posted @ 2007-01-09 10:29 南守拥 阅读(248) 评论(1) 推荐(0)
摘要:客户代码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... 阅读全文
posted @ 2007-01-08 15:45 南守拥 阅读(370) 评论(0) 推荐(0)
摘要: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 ... 阅读全文
posted @ 2007-01-08 12:40 南守拥 阅读(271) 评论(1) 推荐(0)
摘要:客户代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1 Console.WriteLine( root.Responsible.Name );2 Console.WriteLine( leafonelef... 阅读全文
posted @ 2007-01-08 12:34 南守拥 阅读(257) 评论(0) 推荐(0)
摘要:自定义代理类Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Data; 3 4namespace DataLayer 5{ 6 /**//// 7 /// This... 阅读全文
posted @ 2007-01-05 22:53 南守拥 阅读(366) 评论(1) 推荐(0)
摘要: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 ... 阅读全文
posted @ 2007-01-05 17:21 南守拥 阅读(349) 评论(0) 推荐(0)
摘要:操作上的抽象Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1using System;23namespace Gof.Test.Bridge4{5 public interface ITankAction6 {7 strin... 阅读全文
posted @ 2007-01-05 14:09 南守拥 阅读(455) 评论(1) 推荐(0)
摘要: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 ... 阅读全文
posted @ 2007-01-04 22:27 南守拥 阅读(349) 评论(1) 推荐(0)
摘要:外观模式封装系统的复杂性来提高程序的可用性,我们经常用的是数据访问外观类,它隔离了Ado.net的复杂性。 简单的外观例子Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Data; 3usin... 阅读全文
posted @ 2007-01-04 17:59 南守拥 阅读(357) 评论(0) 推荐(0)
摘要:类适配器: 客户程序定义好的接口Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1using System;23namespace Gof.Test.adapter4{5 public interface ICart6 {7 ... 阅读全文
posted @ 2007-01-04 17:26 南守拥 阅读(300) 评论(1) 推荐(0)
摘要:InterestingCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 public class Interesting 2 { 3 public ChangeHandler _change; 4 publi... 阅读全文
posted @ 2006-12-31 10:24 南守拥 阅读(383) 评论(0) 推荐(0)
摘要: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.... 阅读全文
posted @ 2006-12-31 09:50 南守拥 阅读(335) 评论(1) 推荐(0)
摘要:http://www.microsoft.com/china/msdn/library/architecture/architecture/architecturetopic/MVP.mspx?mfr=true主要思想是把以前的View依赖于Bll反转,并把View中的相关控件对象进行抽象。实现后如下:我整理的例子的类之间的关系:/Files/nanshouyong326/MVP.rar 还有几点... 阅读全文
posted @ 2006-11-29 11:48 南守拥 阅读(471) 评论(1) 推荐(0)