|CS 635: Advanced Object-Oriented Design & Programming|
2. Explain how to decouple a program from the type of container used. Give an example. Provide the details of your example.
3. Discuss the type of cohesion found in math libraries.
Is there a way to improve the cohesion?
2. The text introduces the idea of a parameterized factory method. Discuss the type of cohesion and coupling this introduces. Contrast this with the cohesion and coupling in the alternative to the parameterized factory method. When would you choose the parameterized factory method over its alternative?
3. How does using a factory method in a client object differ from a prototype or an abstract factory?
4. Explain the advantages of the prototype over a factory
method. When would you use one over the other? Give
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.
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?