CS 635 Object-Oriented Design & Programming |
---|
2. Select a pattern other than the singleton and discuss it's liabilities. Your choices are: Abstract factory, Adapter, Bridge, Builder, Chain of Responsibility, Command, Composite, Facade, Factory Method, Flyweight, Interpreter, Iterator, Mediator, Memento, Observer, Prototype, Proxy, State, Strategy, Template Method or Visitor.
3. Select one of the following pairs of patterns: Mediator and Observer; Bridge and Adapter; State and Strategy. Discuss the conditions and situations when each pattern should be used over the other.
4. The following patterns were listed as solving tight coupling: Abstract Factory, Bridge, Chain of Responsibility, Command, Facade, Mediator, Observer. Select one of the patterns. Discuss how the pattern reduces coupling. The discussion should cover the coupling that would occur if the pattern was not used, the coupling that does occur when the pattern is used, and how the latter is less coupling than the former.
5. What are the two main design principles used in design patterns.
6. What is control coupling? Give an example. Give one way to reduce control coupling.
7. Explain one of the following types of cohesion: Logical, Temporal, Procedural, Communication, Sequential. (Coincidental and Functional are left off the list on purpose.) Give an example.
8. Beginning Java programmers often create an interface (or an abstract class) to hold constants. Then each class that uses one or more constants inherits the interface (abstract class). What type(s) of cohesion does (or could) such an interface (abstract class) exhibit?
9. What is a primitive method? Why are they considered desirable?