SOFT2201/COMP9201 Week 13 Tutorial
Revisit and Open Discussion 2
This tutorial is mainly focusing on revisiting some tutorial questions you have done for design pat-
Copyright By PowCoder代写 加微信 powcoder
terns, and open discussions on weekly exercises. It is also a good chance for you to communicate
with your tutors if you have any questions.
Question 1: Revisit the Builder Exercise on Week 5
The builder pattern creates an abstraction of the construction process of an object, particularly com-
plex objects with multiple constructors. This allows for the object to maintain a single construction
method and the builder object to manage the construction process.
In week 5 tutorial, you have refactored the design in Question 4 to utilise Builder pattern. Please
model your codebase in a UML class diagram and identify the Builder participants on the UML
according to the code.
Question 2: Revisit the State Exercise on Week 6
In regards to Strategy pattern, the selection or retrieval of the behavioural objects is known by a single
object maintaining links to them. However, State pattern encodes state transition on each state object
which will affect the behaviour of the object maintaining that state.
In week 6 tutorial, you have refactored the design in Question 4 to utilise State pattern. Please model
your codebase in a UML class diagram and identify the State participants on the UML according to
Question 3: Revisit the Observer Exercise on Week 7
Observer is quite different from the structural pattern Adapter because it is something to include ’in
advance’, rather than as a modification to an existing system like Adapter – though it can be involved
in extensions or refactoring as well. Observer handles issues of deep and complex coupling, not by
removing the coupling (the line on a UML diagram will still be there) – but by lessening how involved
that coupling is (the technical term for this is improving the ’connascence’ between the classes).
In week 7 tutorial, you have done an implementation in Question 4 to utilise Observer pattern. Please
model your codebase in a UML class diagram and identify the Observer participants on the UML
according to the code.
SOFT2201/COMP9201 Revisit and Open Discussion 2
Question 4: Revisit the Memento Exercise on Week 10
Memento is somewhat similar to Prototype in its internal structure, but solves a very different prob-
lem. Rather than storing different versions of classes, Memento stores different versions of the in-
ternals of an object. In our previous example, if we were swapping Strategies, or changing strategy
states, Memento would store deep copies of those strategies (unless they were immutable, in which
case they could be shallow copies) in an encapsulated way, ready to be swapped back into our Com-
plexObject to revert it to some previous state.
In week 10 tutorial, you have done an implementation in Question 5 to utilise Memento pattern.
Please model your codebase in a UML class diagram and identify the Memento participants on the
UML according to the code.
Question 5: Open Discussion on Weekly Exercises
An open discussion on weekly exercises 10 and 11 will be held under the guide of your tutor in an
interactive way. Tutors are going to summarise their feedback and observations during their marking
process of weekly exercises, and to address the common problems via discussions. Please note that, if
you have any questions related to assingment 1 and assignment 2, we recommend you to communicate
with your tutor in this tutorial.
Software Design and Construction 1 Page 2 of 2
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com