Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Release date: Tuesday, 09.06.15 - Due date: Sunday, 14.06.15, 23:59
A09_DesignPatterns
in your repository. It contains templates for all the tasks plus more.
8 points |
---|
This task follows a similar idea as our hunt for gangsters in the second assignment.
In the file you will find some anonymous untyped instance specifications (“objects”) with some links between them. Next to each group of instances there is a note with the name of all the design patterns that we presented. Check whether the group of objects could be instances of the classes in the design pattern. If they can not be instances of the respective design pattern, delete the name in the note.
To be more precise:
Client
class.The first “group” for example is just one instance. As you need more than one object for the Adapter Pattern, you should delete “Adapter” from the note next to the first group. And so on.
8 points |
---|
Place the classes and interfaces of an example of one of the patterns (not the Observer pattern) in an Abstractness-Stability-Diagram. You can find the Observer example from the slides with some comments in the file. Describe for each class and interface, why you have placed it at its location1), i.e. discuss the abstractness and stability of the classes and interfaces. Discuss whether SAP, ADP, DIP and SDP are respected.
8 points |
---|
a) Pick a design pattern that might be distributed over two layers and place the classes and interfaces on the higher or the lower layer respectively. You can find an example in the file. Of course you should give us something different from our example. Describe the consequences of distributing the pattern over two layers in two or three sentences!
b) Pick another design pattern that might be distributed over two layers and place the classes and interfaces on the higher or the lower layer respectively. It should of course again be different from our example. Describe the consequences of distributing the pattern over two layers in two or three sentences!
3+3[+6] points |
---|
You may ignore the undo
operation in a) and b).
a) Give an example of the Command pattern. Describe the implementation of relevant operations in pseudo code.
b) Add support for a MacroCommand
, i.e., a command that consists of commands.
Describe the implementation of relevant operations in pseudo code.
c) [optional] Add support for an UndoCommand
, i.e., a command that undoes the previous command, and then the command before, and so on.
Describe the implementation of relevant operations in pseudo code. Give as well the implementation of the undo
operation in the MacroCommand
as well as in another command.