某大学设计模式试题 大家来做做

sun89 2008-11-25 11:32:25
6.Design a remote control program a on a Pocket PC device(which is a PDA based on

Microsoft Windows CE.Net),and support touch screen,GUI programming,and infrared port to

communicate with the TVs).The functions are almost the same with the common TV remote(such

as changing channel,volume,TV/AV change,ON/OFF and anything you think which should be on a

TV remote).The additional functions are the undo,redo command.

Based on MVC pattern,give an Object-Oriented Design using UML diagrams and written text

(plesase be in details)for the above requirements,.Explicitly all design patterns used and

justify your use of them.No code required.



5.There is a coffee shop to server HouseBlend and Espresso coffee.Each coffee can be

served with the following condiments:Milk,Mocha.Using Decorator pattern to construct the

coffee shop program to compute every beverage’s cost with its description.

Class beverage{

String decription;

String getDescription(){return description;}

Double cost();

}

Draw the pattern class diagram,and full code(class

CondimentDecorator,HouseBlend,Espresso,Milk,Mocha,StarBuzzCoffee and other classes

required) to construct the program including a test drive(StarBuzzCoffee class).



4.In object-oriented programming one is advised to avoid case(and if )statements.Select

one design pattern that helps avoid case statements and explain how it helps.



3.The Singleton Pattern relies on two key Java constructs or features to ensure that(1)at

most only one object of a class is ever created by clients,and (2)a reference to the

unique instance of the singleton class is always accessible to clients.Name and briefly

explain these features.

Write the code of this pattern.



2.Factory Method and Abstract Factory design patterns are quite similar.How are they

similar and how are they different?
...全文
622 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
lxxzhy 2008-11-26
  • 打赏
  • 举报
回复
有意思.
herakles86 2008-11-26
  • 打赏
  • 举报
回复
up
jhr924 2008-11-26
  • 打赏
  • 举报
回复
外国语大学的
sun89 2008-11-26
  • 打赏
  • 举报
回复
up
myjava_024 2008-11-26
  • 打赏
  • 举报
回复
呵呵,学习外语了
Successman2013 2008-11-26
  • 打赏
  • 举报
回复
关注,学习,感兴趣者或高手们,请尽可能详解,让小弟学习学习!谢谢
shenjie1989 2008-11-26
  • 打赏
  • 举报
回复
又是老外的题目
niuniu20008 2008-11-26
  • 打赏
  • 举报
回复
学习
nihuajie05 2008-11-26
  • 打赏
  • 举报
回复
LZ,浦口的吧。。。
哎。。。
学校里考考就算了,还拿出来吓人。。真是
去年的卷子了。。。落伍啊,要不你把今天下午的新题目法上来看看?
maleangel 2008-11-26
  • 打赏
  • 举报
回复
6:太繁了,不做了

5:教材上都有

4:监听者模式,也就是反射。

3:①将构造方法私有化 ②开发一个公有的方法来得到实例,(没有就调用私有的构造方法)。

2:教材上也有
huangxiaofei 2008-11-26
  • 打赏
  • 举报
回复
我给翻译成中文吧:
6. 设计一个Pocket PC设备的远程控制程序(基于微软Windows CE .NET平台),并支持触摸屏,GUI编程,以及与电视设备的通讯接口。使其完成类似于电视遥控器的功能(例如换台,调整音量,视频/电视信号转换,开机/关机等等一切你认为电视遥控器应当拥有的功能).附加的功能是undo,redo指令。
基于MVC模式,给出面向对象的UML设计图并附加上述要求的设计文档(请写出细节),写出你所所用到的所有设计模式,并说明如何使用。不需要具体的代码。

5. 有一家咖啡店提供HouseBlend咖啡和Espresso咖啡。每一种咖啡需要用到如下配料:牛奶,摩卡。使用装饰模式构建咖啡店程序计算每种饮料的花费以及其描述。

Class beverage{

String decription;

String getDescription(){return description;}

Double cost();

}

画出模式类图,实现完整的类代码(包括类CondimentDecorator,HouseBlend,Espresso,Milk,Mocha,StarBuzzCoffee以及其他所需的类)构建程序,包括一个驱动测试类(StarBuzzCoffee类)。

4. 在面向对象设计理论中往往提倡尽量不使用case(和if)声明。选择一种设计模式,有助于避免使用case声明,并解释如何避免。

3. 单件模式(Singleton Pattern)依赖两项关键的java构造器或者特性以保证其实现:
(1).最多只有一个类对象是被客户端建立的;
(2). 对单件类的唯一实例的引用对于客户端总是可见的。
简明第阐述这些特性,并对其命名。
写出代码实现这些模式。

2.工厂方法和抽象工厂设计模式二者十分相似。他们各有什么相似点和不同点?
不善^ 2008-11-25
  • 打赏
  • 举报
回复
全E??
oh no!看不懂

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧