摘要: 题目:定义一个俱乐部,它的顾客有三个状态:访客(VistorState), 会员(MemberState),贵宾(VIPState)。每个顾客都有一 个帐户(ClubAccount),帐户上存放顾客的存款,根据存款 的不同数量切换会员的级别,其中0~100 为访客,100~1000 为会员,1000... 阅读全文
posted @ 2015-12-30 13:54 鬼峡 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 分析:抽象组件——具体组件——抽象装饰类_具体装饰类相关UML图:类总括:相关代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tas... 阅读全文
posted @ 2015-12-23 17:38 鬼峡 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Key point: director----builder----concrete builderUML图如下:所需class如下:具体代码如下:using System;using System.Collections.Generic;using System.Linq;using System... 阅读全文
posted @ 2015-11-28 22:06 鬼峡 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 分析:产品之间存在着共性——需引入接口 ——定义共性——抽象产品类 工厂共同实现的接口——定义共同接口——抽象工厂类相关UML图:类总括:具体代码:using System;using System.Collections.Generic;using System.Lin... 阅读全文
posted @ 2015-11-07 10:17 鬼峡 阅读(205) 评论(1) 推荐(0) 编辑