
Name __________________________________________
The following might be names of patterns:! Abstract Class, Abstract Factory, Adapter, Bridge, Builder,
Chain of Responsibility, Collaborator, Command, Command Processor, Decorator, Façade, Factory
Method, Flyweight, Interpreter, Mediator, Memento, Observer, Prototype, Proxy, Singleton, Specifica-
tion, State, Strategy
The purpose of many of the design patterns is to make it easy to change some property of the
system.! What design pattern would you use to make it easy to change:
1. (3 points) The way a set of objects interact with each other
2. (3 points) The algorithm that an object uses
3. (3 points) The implementation of an abstraction
4. (3 points) The class of the object that a method returns.
5. (3 points) The kind and number of objects that react to changes in the object you are designing.
6. (3 points) The internal state of an object, but you want to be able to remember this state and then
later tell the object to go back to that state.
7. (3 points)! What design pattern should you think of first when you want to implement undo?
8. (3 points) What design pattern should you think of first when you want to implement one and only
one instance of a class?
9. (3 points) What design pattern should you think of when you want to hide how you construct a
complex object?
10.(3 points) What design pattern should you think of when when you have a class that you can not
modify conveniently?
Suppose you were designing the file system of an operating system.
5/14/09"CS 635 Final"Page 1 of 3