01 2007 档案
摘要:在项目中可能遇到这样的情况,我们要收集项目中的所有信息,而每种信息的收集方法是不一样的,我就遇到了这样的情况。起初我用的是直接收集合并,在二个时就已经很费力了,这次是把所有的信息(有11处之多)收集起来。我想到了策略模式的意图,把策略选择逻辑和策略执行逻辑分开。所以我就把4种选择方法分别做成了四种策略,每种策略的取分数方法做为策略的执行内容。于是上面的类图就出现了。通过应用策略模式我们把一个复杂...
阅读全文
摘要:照着上面的例子做了,怎么不能用啊。错误如下: 错误Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1NHibernate.MappingException: Could not compile the mapping document: QuickSt...
阅读全文
摘要:ElementCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace Gof.Test.Vi...
阅读全文
摘要:AggregateCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace Gof.Test....
阅读全文
摘要:ISimpleWriterCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace Gof.N...
阅读全文
摘要:CommandCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace Gof.Test.In...
阅读全文
摘要:菜单命令 ShowCommandCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Collections.Generic; 3using System.Text; 4using System.W...
阅读全文
摘要:产品类Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2using System.Collections.Generic; 3using System.Text; 4 5namespace Gof.Test.Strate...
阅读全文
摘要:语境: DoorCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1using System; 2 3namespace Gof.Test.State 4{ 5 public delegate void ChangeHandler(Do...
阅读全文
摘要:一个经典实例 - 排序 自定义类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 ...
阅读全文
摘要:需要的JavaScriptCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 Div设置Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHi...
阅读全文
摘要:客户代码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 ...
阅读全文

浙公网安备 33010602011771号