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.
Adapter
verses the Bridge
Strategy
verses the Decorator
Decorator
verses the Chain of Responsibility
Select
one of the following patterns – Adapter, Composite, and Façade and
discuss the consequences (good and bad) of the pattern.
Select
one of the following patterns – Visitor, Template Method or Iterator and
discuss the consequences (good and bad) of the pattern.
Briefly
outline the State pattern. The state pattern is often implemented using several
other patterns. List one and explain why it is used.
Briefly
discuss how the Visitor pattern operates.
Give
three different uses of the Proxy pattern.
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.
Give
three different patterns that in some way support undo. Select one of the
patterns and describe how it supports undo.
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.
The
Memento pattern stores the state of the Memento’s Originator. Explain how
the avoids violating the information hiding of the Originator’s state.
The
text claims that Mediator and Observer are competing patterns. Explain.
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.