You are on page 1of 6
JUNE 2013 EXAMINATION MODULE DESCRIPTION MODULE CODE FACULTY QUALIFICATION EXAMINATION DATE DURATION (IN MINUTES) TOTAL PAGES ADDENDUMS: EXAMINER MODERATOR INSTRUCTIONS NONE DO NOT TURN THE PAGE BEFORE TOLD TO DO SO P--“_ Nelson Mandda Metropolitan ed University for tomorrow < « DEVELOPMENT SOFTWARE IV ONT 4101 ENGINEERING, THE BUILT ENVIRONMENT AND INFORMATION TECHNOLOGY BTECHIT UN SUNE 2013, 4.0" 180 100 Marks 7 (Including this cover page) Included in page total JF VAN NIEKERK LA GROBBELAAR ANSWER ALL QUESTIONS REQUIREMENTS ONT4101 QUESTION. Suppose you have been hired by a game development company. This company is working o1 new version of the classic “Space Invaders” game. In this game a player is in control of spaceship and has to shoot at enemy spaceships which advance down the screen in formatio (Similar to the game you had to work on during your practical work) Each “level the enemy ships are recreated but assigned a new algorithm controlling the si behavior, These enemy behaviors are what make the game interesting and fun. Currently game designers have decided on two behaviors named DiveBombing and ZigZagging. Ide the game designers would like to be able to add additional behaviors to the game at a lat stage. 1.1 Draw a high-level class diagram of how a strategy pattern based solution to the aboy problem would look. For now your design only needs to cater for the two enemy strategi mentioned above but more might be needed at a later stage (Note: You have to show tl client application too. This diagram does not need to show any method level compone! or classes that do not form part of the strategy pattern itself). 3) 1.2. The strategy pattern is based on three design principles. Use the above class diagram, conjunction with a discussion of the three design principles to explain how the strat pattern could be used to make the client application more resistant to change. (Hint: Make sure your explanation clearly discusses each of the three design princip! and why/how that specific design principle helps to make the application more resistant change. Also explain how each principle “can be seen" in the class diagram.) @) ONT4101 Page 3 of | QUESTION 2 ti ‘The Observer pattern is used extensively in many modern software development approache: In the .NET framework, for example, it is used as the basis for the event driven model 2.1 Draw a high level class diagram of the “generic” observer pattern (This diagram shoul show detail down to the level of methods specific to the pattern, as well as the clas: themselves). ( 2.2. Define the observer pattern (formal definition). ¢ Assume you are busy implementing such a GUI report system. Write the code for thi following: The interfaces needed for the pattern implementation * ONE example of each type of concrete class (Note if you have more than one class that has the same role in the pattern you only need to code one of them) Note: Your code does not need to show any “real” functionality of the classes/objects. Show! only the code relating to the implementation of the pattern. Use comments to indicate where! other code might go. You MUST show/use the correct parameters for methods depending on| the pattern. You may assume the state of the dataset can be passed to other objects as a parameter called Data which is declared as: object theData (17)

You might also like