SDSU CS 635 Advanced Object-Oriented Design & Programming
Spring Semester, 2001
Exams - 1998
    Course Web site        
© 2001, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 06-May-01

Contents of Doc 1, Exams - 1998


CS 635 Exams, 1998

CS 635 Midterm


Answer 7 questions. Indicate which 7 questions you are answering. Do not answer more than 7 questions. Each question is worth 10 points.

1a. List two patterns that help reduce algorithmic dependencies in classes.
1b. Select one of the patterns from part a and explain how to use it to reduce algorithmic dependencies.

2. Describe how the Observer reduces coupling between classes.

3. Explain how using the Prototype to replace Factory Methods can reduce subclassing.

4. Select one pattern and describe how it uses the design goal of design to an interface. What are liabilities of designing to an interface in this case.

5. Describe the ProductTrader pattern. Why would one use this pattern over the a parameterized factory method?

6. Explain the differences between the Functor, Command, and Command Processor patterns.

7. What is Interface Coupling? Give two ways to reduce it.

8. What is the difference between internal object coupling and cohesion of an object.

9. Define procedural cohesion.

10. Describe the push and pull version of Observer. What is the strength of the push version over the pull?


CS 635 Final Exam


Answer 9 questions. Indicate which 9 questions you are answering. Do not answer more than 9 questions. Each question is worth 10 points.

In the follow 3 problems two patterns are listed. The paired patterns are similar in some fashion. Explain how the patterns are different. You should cover when each pattern would be used over the other, the differences in intent of the patterns and any structural differences.

  1. Adapter verses the Bridge
  2. Strategy verses the Decorator
  3. Decorator verses the Chain of Responsibility
  4. Select one of the following patterns – Adapter, Composite, and Façade and discuss the consequences (good and bad) of the pattern.
  5. Select one of the following patterns – Visitor, Template Method or Iterator and discuss the consequences (good and bad) of the pattern.
  6. Briefly outline the State pattern. The state pattern is often implemented using several other patterns. List one and explain why it is used.
  7. Briefly discuss how the Visitor pattern operates.
  8. Give three different uses of the Proxy pattern.
  9. The patterns in the text are grouped into three types of patterns: Creational, Structural, and Behavioral. Clearly the creational patterns are related to creating objects. The State pattern is listed as behavioral, when it clearly defines some structure. The Proxy is listed as a Structural pattern when it clearly has behavior. What is the difference between Structural and Behavioral patterns? Provide criteria for determining if a new pattern should be considered Structural or Behavioral. The criteria must also explain why the current patterns are classified as they are.
  10. Give three different patterns that in some way support undo. Select one of the patterns and describe how it supports undo.
  11. An important aspect of the Flyweight pattern is not storing extrinsic state inside of the Flyweight object. Given an example where the Flyweight pattern might be used and will save space by not storing the extrinsic state of the Flyweight object in the object. Note removing an integer from the Flyweight object and storing it elsewhere does not save space.
  12. The Memento pattern stores the state of the Memento’s Originator. Explain how the avoids violating the information hiding of the Originator’s state.
  13. The text claims that Mediator and Observer are competing patterns. Explain.
  14. A common problem in applications with a GUI interface is supporting multiple look-and-feel standards (like Open Windows and Motif on Sun Workstations) on a single platform and multiple window systems (like Macintosh, Unix, Microsoft Windows) of different platforms. Briefly discuss which patterns help support multiple look-and-feel and multiple window systems.



Copyright ©, All rights reserved.
2001 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA.
OpenContent license defines the copyright on this document.

    visitors since 06-May-01