(Common to Information Technology, Computer Science and Systems ... candidates of particular constituency, their bio-dat
Code No: R05421205
SET-1
JAWAHARLAL NEHRU TECHNOLOGY UNIVERSITY, HYDERABAD R05 IV B.Tech. II Semester Regular Exams, April/May – 2009 DESIGN PATTERNS (Common to Information Technology, Computer Science and Systems Engineering) Time: 3 hours
Max. Marks.80
.in
Answer any Five questions All questions carry equal marks --1. What is a design pattern and what are its four essential elements?
16
or ld
2. Explain how encapsulating the formatting problem of document editor can be solved using design patterns. 16
3. Draw the class diagram and explain the collaboration, with sample code, of different classes in the creational design pattern that helps in creation of families of related or dependent objects without specifying their concrete classes. 16
Aj
nt
uW
4. a. How do you design an application with classes that have incompatible interfaces? Explain, briefly, with class diagram. 4 b. How do you design an application where the implementation of an abstraction is likely to change subsequently? Explain, briefly, with class diagram. 4 c. Explain the implementation issues of a design with recursive composition of objects such as tree structures. 8 5. Explain, with a text editor example, how you design an application with a class whose responsibilities dynamically change. Draw the class diagram and explain. Discuss the implementation issues briefly. 16 6. How do you design the software when more than one object may handle a request and the handler is not a priori? Draw the class diagram and explain with an example. Discuss the consequence and implementation issues briefly. 16 7. a. Explain the structure of Mediator design pattern with a class diagram and discuss the collaboration with a sequence diagram. 8 b. Discuss the consequences and implementation issues of Memento design pattern. 8 8. Discuss the several ways the design patterns affect the way object oriented software is designed. 16
Code No: R05421205
SET-2
JAWAHARLAL NEHRU TECHNOLOGY UNIVERSITY, HYDERABAD R05 IV B.Tech. II Semester Regular Exams, April/May – 2009 DESIGN PATTERNS (Common to Information Technology, Computer Science and Systems Engineering) Max. Marks.80
Answer any Five questions All questions carry equal marks --1. Explain how we describe design patterns.
.in
Time: 3 hours
16
or ld
2. Explain how design patterns provide solution for portability onto diversified platforms with different look-and-feel standards. 16
3. Explain the structure of builder design pattern with class diagram and describe the collaboration with a sequence diagram. Explain its applicability to document format conversion application with class diagram. 16 4. a. b. c. d.
Briefly describe the consequences of Adapter design pattern When do you use Bridge pattern? What are the implementation considerations of Bridge pattern What are consequences of Composite pattern?
4 4 4 4
uW
5. How do you provide a uniform interface to a set of interfaces in a subsystem? Explain with an example of compiler. Draw the class diagram and discuss implementation issues. 16
nt
6. It is required to design the software for a server in Election Commission with the following requirements. Any voter should be able to register and modify the personal details. The voter should be able to request election schedules, candidates of particular constituency, their bio-data, address of the polling booths, etc. The server should queue the requests and execute them. The voter should be able undo the changes. Design the software with suitable design pattern and explain with a class diagram. Discuss the collaborations. 16
Aj
7. a. What is a Change Manager and explain the structure with a class diagram. 8 b. Explain the State design pattern with an example from TCP connection example. 8 8. Discuss the following aspects of behavioral patterns briefly: a. Encapsulating variation b. Objects as Arguments c. Should communication be encapsulated or distributed? d. Decoupling senders and receivers.
4x4
SET-3
Code No: R05421205
JAWAHARLAL NEHRU TECHNOLOGY UNIVERSITY, HYDERABAD R05 IV B.Tech. II Semester Regular Exams, April/May – 2009 DESIGN PATTERNS (Common to Information Technology, Computer Science and Systems Engineering) Max. Marks.80 Answer any Five questions All questions carry equal marks ---
.in
Time: 3 hours
or ld
1. a. Compare and contrast class inheritance and interface inheritance 4 b. Explain the advantages of programming to an interface over programming to an implementation. 4 c. What is the difference between white-box reuse and black-box reuse? 4 d. Compare Inheritance versus parameterized types. 4 2. How can the textual analysis problem of document editor be solved using design patterns? 16 3.
Explain the implementation issues of Factory Method with sample code. 16
uW
4. What are the applications of Bridge pattern? Explain the structure of Bridge pattern with Window system example. 16
nt
5. Explain the structure of flyweight design pattern with a class diagram. Give an example from text editor. Discuss the consequences and implementation issues. 16 6. A reputed software company is developing CAD software. It is required that the software should read licenses details, number of simultaneous users, permitted features, etc., from a configuration file with a specific syntax. Design the software with suitable design pattern and explain with a class diagram. Briefly discuss the consequences and implementation issues. 16
Aj
7. a. Explain the structure of Strategy design pattern with a class diagram and briefly discuss its benefits and drawbacks. 8 b. Discuss the consequences and implementation issues of Template Method design pattern 8
8. Explain the steps involved in selecting a design pattern.
16
SET-4
Code No: R05421205
JAWAHARLAL NEHRU TECHNOLOGY UNIVERSITY, HYDERABAD R05 IV B.Tech. II Semester Regular Exams, April/May – 2009 DESIGN PATTERNS (Common to Information Technology, Computer Science and Systems Engineering) Max. Marks.80 Answer any Five questions All questions carry equal marks ---
.in
Time: 3 hours
1. Explain briefly common causes of redesign along with the design patterns that 16
or ld
address them.
2. How can the user operations be handled in the design of document editor? 16
3. Explain the class design structure of an editor for music scores with suitable design pattern and discuss the implementation issues.
16
4. a. What is the problem with adapters and how can Two-way adapters solve the problem?
b. Explain Composite pattern with an example from drawing editor.
4
12
uW
5. Consider a system which receives data from different sensors and displays the results after processing the data. Design the software with suitable design pattern, if the software has to provide a controlled access to the sensors. Discuss the consequences and implementation issues briefly. 6. Discuss the implementation issues of Iterator.
16 16
7. a. Explain the collaborations and consequences of Visitor design pattern. 8
nt
b. Discuss how decoupling of senders and receivers is achieved in different design patterns.
8
8. Discuss the several ways the design patterns affect the way object oriented
Aj
software is designed.
16