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?

解决方案 »

  1.   

    我给翻译成中文吧:
    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.工厂方法和抽象工厂设计模式二者十分相似。他们各有什么相似点和不同点?