Release date: Wednesday, 26.06.13 - Due date: Monday, 01.07.13, 23:59
So, it's the cloud BAKERY 2100 again . You can find the incomplete class diagrams as well as the use case diagram and the analysis object model in the file
A9T01_DesignPattern in your repository.
In the following we ask for three design patterns. It is enough, when you give us the classes and the relationships between the classes. Fields and methods are not required.
a) One developing engineer of the “cloud BAKERY 2100” found out, that you can compose bread types to tasty new bread types. (You just need to combine the ingredients proportionally.) Which design pattern do you suggest to implement this? Complete the class diagram and explain in one or two sentences why you have chosen the design pattern:
OrderBakedGoodsController collaborates with the
CreditCardCompanyInterface, but unfortunately an important Bank only offers the
LegacyBankingInterface. Which design pattern solves this situation? Complete the class diagram and explain in one or two sentences why you have chosen the design pattern:
c) In the analysis object model the
CallMaintainerController depends on the
MaintenanceInterface, but we don’t want to have dependencies from controllers to the user interface. Which design pattern (or even something simpler) solves this situation? Complete the class diagram and explain in one or two sentences why you have chosen the design pattern:
d) If a system has a “high” and a “low” layer, which layer is allowed to access which? Note at each type in the last class diagram, whether it belongs to “high” or “low”.
Bis a subclass of
Aand both contain a method
In the lecture you became familiar with Structural Pattern (Adapter, Bridge, Composite, Facade, [soon: Proxy]), Behavioral Pattern (Command, Observer, Strategy), and the Architectural Pattern “Model View Controller”. You learned as well about the Creational Pattern (Abstract Factory, Builder, Singleton). Knowing design pattern is essential for being productive in Object Oriented Software Construction. In addition they are not only useful for the construction of software, but as well for reading and understanding it.
Prepare the software you are about to study:
Your task is to find three design pattern in the source code (there are many more!) and be ready to explain them. Write a short text describing where to find the design pattern in the code and how it works. For each design pattern you should at least describe
Write it in your own words! Don't copy from the thousand resources you can find on the web about JHotDraw. Of course you can read them, but don't copy them. You even find explanations in the project itself e.g.in the pattlets folder.
S s = new T(); B input = new B(); B output = s.m(input);
Historical side note: The implications of substitutability on parameter and return types was already discussed before Barbara H. Liskov and Jeanette M. Wing suggested their criterion for substitutability. Nevertheless, it is interesting that behavioral subtyping implies the older criteria for subtyping of functions.