You are on page 1of 4
1231 No of Pages :4 ‘Course Code : 08XTEG Roll No: (To be filled in by the candidate) PSG COLLEGE OF TECHNOLOGY, COIMBATORE - 641 004 SEMESTER EXAMINATIONS, — APRIL / MAY - 2012 MSc- THEROETICAL COMPUTER SCIENCE — Semester: 6 O9XTEG SOFTWARE PATTERNS Time :3 Hours Maximum Marks : 100 INSTRUCTIONS: L. Group F and Group Ti questions should be answered in the Main Answer Book 2. Answer any FOUR questions in Group IL 3. Aliswer ALL questions in Group I and Group I 4. Group III - Multiple Choice questions - (which will be given to the candidates half an hour before the scheduled close of the examination) should be answered only in the space provided in the Main Answer Book, ‘GROUPT Marks: 10x3=30 1. Design patterns he'p to assess the quality of a software design based on few principles. State any three principles. With the help of an example, distinguish between a design pattern and an architectural pattern, Can a decorator iin the Decorator Pattern be used to add additional methods? Justify. When and why should the Stratagy pattern be used? ‘Captures and extemalizes an object's internal state so that it can be restored later, all wihout violating encapsulation”. Which pattern does this statement signify? 6. Observers will only stay consistent with their subjects, if the notification operation is called at appropriate times. This operation should be callled either by the subject itself, or by the client object that has caused the change. Qutine the advantages and disadvantages of these two approaches. What is the disadvantage of using Singleton pattern? Which architectural pattem is best suited fer this problem? “UNIX supports this stye by providing a notation for connecting components (represented as UNIX processes) and by providing run time mechanisms for implemanting pipes". 9, When you put up a facade, you're usually creating an outward appearance which conceals a different reality’. Justify the statement. 10. “A pattern that tells how to go from aprablem to a bad solution isan antipattem'. Justify whether the above statement is true or false. io oae oo GROUP IL Marks: 4.x 15 = 60 11, a) Enlighten the benefits of design patterns in soltware development. (5) b) How to apply design pattems during sofware development? What steps are suggested by Gamma et al. forthe etlective use of patterns? [10] Page Ne: | 1231 No of Pages :4 ‘Course Code : 08XTEG 12. a} Apply Abstract Factory pattern for the creation of Animal objects like Shark and Elephant. Define 2 breathe() method in each of the classes. Create factories for whether the animal lives in water or land, Also have two more-abjects in each category. (8) b) Explain an example of your cheice which is best suited to Prototype pattem. Also. justify how Builder pattern dees not fit welll to the same case study. 13. a) Suppose we have to develop an Image Viewer application to view BMP files under Windows OS. At the same time, we have io extend ito view other image formats ike JPEG, JPG etc under Windows OS, Now we have to use the Image for other OS like LINUX er UNIX. Apply the best suitable pattern for the above mentioned design problem. V7) b) Give one problem each of your choice to justify the usage of three types of Proxy patterns, Describe the coniext, structure, collaborations, benefits and liabilities and sample code for the proxy pattern 1B] 14. a) “Suppose an image editor has been designed and. user can have the option of opening fle fom various ways ike menu, tool bar, double click on a file in the explorer". Provide a good design approach to this programming issue using one of the behavioral pattems. v7) b) Model a real work! scenario taken from a shipping system using Ghain of Responsibility pattern. Let's say the company takes arders electronically {rom either the web or some sort of web service. The steps 10 complate and handle an order vary widely based en the customer, size of order, destination, and a host of other things. The business logic changes rapidly as special cases crop up and disappear. Let's say that following are the contrived fictional cases: + Orders to the European Community require a diferent sat of value added tax calculations and we do intemational shipping through a different set of carriers + Large bulk orders are handled separately within the warehouse and might go.10 different shipping cartiers. + Most Favored Customer: Your largest customer has special requirements for shipping and tracking + All other domestic and international arders are handled in a genericmanner. (8) 15, a) Most modem games Use three dimensional graphics. The graphics are constantly improving, to the rate of close to photo-realism in real time rendered graphics. This has resulted in Graphics Engines being a larger part of a game development project and many Graphics Engines are reused in several projects. To achieve a better decoupling between the Graphics Engine and the rest of the gama, a good design for communication between the two has to be made. The intention of this pattern is to discuss how looser coupling of the SD Graphics Engine can be achieved in.a Game Engine (or other applications in need of 3D Graphics Engine). Discuss in detail Model-View-Contraliar architecture pattern and. explain how to implement the appropriate parts of that pattern in a Graphics Engine. IB) b)_ Much of agent system development to-date has been done on an ad hoc basis. Apply blackboard pattern to the problem given below. Context: You already have a set of agents that are specialized to perform a particular subtask of an overall task. You need to provide a medium that allows them to. monitor each other and build on their mutual progress. Problem: How do you ensure the cohesion af the agents’? m1 FDIRL. JEND/ Page Nor? 1231 No of Pages :4 ‘Course Code : 08XTEG Roll No: Write the Alphabet of your choice answer for each question in the space provided in the Main Answer Book {Do not attach this question paper along with the Main Answer Book) ‘APRIL / MAY ~2012 O9XTEG SOFTWARE PATTERNS GROUP II Marks: 10x 1= 10 1) Pattern is nething but A) aclass diagram B) an architecture C) a framework D) a description of communicating objects and classes that are customized ta solve a general design problem in a particular context I) Give one statement which is false. ‘A) Cohesion is how strengly the internal operations of a routine are related each other, B) Consequences are the cause -and-etfect of using the pattem C) Forces are the lactors at play in a particular prablem that constrain and shape the possible solutions. D) The entities involved in the pattern are provided in the prablem. II) Kdentity the pattern with the structure given i ast ‘seileh e =ner=7pe case 22RAORAPH Trecorveransrakara saevopt {aler-2n case Ja] Fustauaeeor eile en) case [eke A) Fastory method B) Bridge C) Builder D) Observer Page No: 1231 No of Pages :4 ‘Course Code : 08XTEG IV)" Which are considered formal business concepts ready for software modeling in UML? A) running, walking, crawling B) drive, steer, unload C} slicing, dicing, chopping D) recording, bank account, car V) Attach additional res ponsbillties to an object dynamically. It provides a flexible altemative to sub classing for extending functionality, A) Chain of Responsbility B) Adapter C) Composite 'D) Decorator VI) _ Which ef the following programming languages is best suited to design patterns? AjJava BY C C)HTML —-B) Cobol Vil) Allobject-oriented programming languages must have the 3 following teatures A) association, inheritance, objects B) inheritance, polymorphism, encapsulation ©) inheritance, association, encapsulation D) state, behavior, identity VII) The first dasign result which should consider some functions and properties of quality, sometimes environment of the software, A) design pattem B) framework C) architecture D) workflow IX) Provides a way to access the elements of an aggregate object sequentially without ‘exposing its underlying representation Ay herator B) Visitor) Compesita Dy Command. ) Which pattern does this diagram represent? seca a —_,. lh le wen zal ‘sVesr vane Ws eae, wien = Sein supesrsra ‘A) Chain of Respansbilty B) Visiter ¢) Command D) Strategy Page Ne:

You might also like