12 Questions for Final Exam - Advanced Object Oriented Programming | CS 635, Exams of Computer Science

Material Type: Exam; Professor: Whitney; Class: ADV OBJ ORIENT DSGN PROG; Subject: Computer Science; University: San Diego State University; Term: Spring 2009;

Typology: Exams

Pre 2010

Uploaded on 03/28/2010

koofers-user-oz3
koofers-user-oz3 🇺🇸

5

(1)

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Name __________________________________________
Answer 9 of the following questions. Indicate which of the questions you wish to be graded.
Answer essay questions as briefly as possible. Since the midterm we have covered the follow-
ing patterns: Functor, Interpreter, Strategy, State, Flyweight, Factory Method, Abstract Factory,
Prototype, Builder, Model-View-Controller, Smart UI, Memento, Bridge, Facade, Pipe & Filters
and Broker.
1. Many design patterns make it easy to change some aspect of a system. Which pattern
would best make it easy to change:
A. The type of an object that a method returns.
B. You need to change what is created from a complex description of the object.
C. You need to be able to change the hardware and software platform an object runs on.
2. The text claims that design patterns help overcome some common causes of redesign of a
system. What pattern would you use to handle the following issues.
A. Algorithmic dependencies.
B. Dependence on object representations or implementations.
3. Since the midterm we have covered three patterns that often use the Flyweight pattern. List
two such patterns.
4. What is the difference between intrinsic and extrinsic state? Give an example of each.
5. Under what conditions does the Smart UI pattern indicate that one should not use the MVC
pattern in developing desk-top GUI applications?
6. The Builder pattern would be simpler to implement if the directory and builder were com-
bined into one class. What advantages does we gain by keeping them separate?
7. The text states that one can allow clients to bypass a facade and interact with components
of the subsystem. What are the consequences (good & bad) of doing this?
5/14/09!CS 635 Final Exam!Page 1 of 2
pf2

Partial preview of the text

Download 12 Questions for Final Exam - Advanced Object Oriented Programming | CS 635 and more Exams Computer Science in PDF only on Docsity!

Name __________________________________________ Answer 9 of the following questions. Indicate which of the questions you wish to be graded. Answer essay questions as briefly as possible. Since the midterm we have covered the follow- ing patterns: Functor, Interpreter, Strategy, State, Flyweight, Factory Method, Abstract Factory, Prototype, Builder, Model-View-Controller, Smart UI, Memento, Bridge, Facade, Pipe & Filters and Broker.

  1. Many design patterns make it easy to change some aspect of a system. Which pattern would best make it easy to change: A. The type of an object that a method returns. B. You need to change what is created from a complex description of the object. C. You need to be able to change the hardware and software platform an object runs on.
  2. The text claims that design patterns help overcome some common causes of redesign of a system. What pattern would you use to handle the following issues. A. Algorithmic dependencies. B. Dependence on object representations or implementations.
  3. Since the midterm we have covered three patterns that often use the Flyweight pattern. List two such patterns.
  4. What is the difference between intrinsic and extrinsic state? Give an example of each.
  5. Under what conditions does the Smart UI pattern indicate that one should not use the MVC pattern in developing desk-top GUI applications?
  6. The Builder pattern would be simpler to implement if the directory and builder were com- bined into one class. What advantages does we gain by keeping them separate?
  7. The text states that one can allow clients to bypass a facade and interact with components of the subsystem. What are the consequences (good & bad) of doing this? 5/14/09 CS 635 Final Exam Page 1 of 2
  1. We have a class Foo that has one field (instance variable or data member) of type Bar. The class Bar has one field of type int (integer). Show how to implement a deep copy of Foo in your language of choice (Java, C++, or Smalltalk).
  2. The memento pattern states that it does not violate encapsulation but yet accesses an ob- ject's internal state. Explain how the memento does not violate encapsulation and discuss your language's support for this feature of the memento.
  3. Explain the Pipe and FIlters pattern.
  4. Explain the State pattern.
  5. Explain the MVC pattern. 5/14/09 CS 635 Final Exam Page 2 of 2