摘要: 适配器模式将不改变原有实现的基础上,原来本不兼容的接口转换为兼容的接口: eg.1 arraylistTOother Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 using System; 2 using System.Collection... 阅读全文
posted @ 2009-05-01 21:03 愚蠢的笨蛋 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 用克隆的方法来创建 prototype Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> //游戏魂斗罗,RUN描述主角的敌人 //抽象类 public abstract class NormalActor { // publ... 阅读全文
posted @ 2009-04-30 15:42 愚蠢的笨蛋 阅读(173) 评论(1) 推荐(0) 编辑
摘要: 做一个汽车性能试验的项目: 先建立抽象car: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->abstract class AbstractCar { public abstract void Starup(); public ab... 阅读全文
posted @ 2009-04-28 15:02 愚蠢的笨蛋 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Builder类: builder Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->abstract class House { } public abstract class Builder { public abstract void... 阅读全文
posted @ 2009-04-27 20:30 愚蠢的笨蛋 阅读(129) 评论(0) 推荐(0) 编辑
摘要: eg.AF Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System; using System.Collections.Generic; using System.Text; namespace abstractFactory { ... 阅读全文
posted @ 2009-04-26 17:27 愚蠢的笨蛋 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 实现singleton基础代码: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> public class singleton { private static singleton instance; p... 阅读全文
posted @ 2009-04-24 17:48 愚蠢的笨蛋 阅读(352) 评论(0) 推荐(0) 编辑