24T2 Week 9
Wednesday 2PM - 5PM (W14A)
Thursday 11AM - 2PM (H11A)
Slides by Christian Tolentino (z5420628)
This tutorial should be relatively short :)
In groups, determine a possible pattern that could be used to solve each of the following problems:
Then pick one and start to think about potential entities and draw up a rough UML diagram.
In groups, determine a possible pattern that could be used to solve each of the following problems:
Then pick one and start to think about potential entities and draw up a rough UML diagram.
In groups, discuss the following examples. Identify the code smells and any underlying design problems associated with them.
a) Mark, Bill and Jeff are working on a PetShop application. The PetShop has functionality to feed, clean and exercise different types of animals. Mark notices that each time he adds a new species of animal to his system, he also has to rewrite all the methods in the PetShop so it can take care of the new animal.
Text
What type of pattern?
Behavioural pattern
The template pattern is a pattern that defines the skeleton of an algorithm in a method, deferring some steps to subclasses. This pattern lets subclasses redefine certain steps of an algorithm without changing its structure.
If anyone has any questions about one of them we can discuss together :)