COM1204 Summer 2003 Final Exam Review - Prof. Futrelle

To be given 8am Wednesday, August 20, 335 Shillman - Closed book/notes

Version of 18 August


There will be two questions, both involving design patterns. There will be no UML question.

The State Design Pattern question: This question will give you a state diagram similar to the ones you can see on Quiz 2 A and B. It will then explain what type of code you are supposed to design and write out to implement a system that behaves as the diagram does. You will also be asked to put proper Java comments into your code for any classes and methods that need explaining. Here's a typical diagram:

Basically, you'd be asked to design an abstract state class and subclasses for the specific states, as well as an interface to hold each state object. You'd then be asked to design an object that has a state and can respond to two different commands (in the example above, "Up" and "Down"). The commands to the object with a state would be passed to the states themselves which would return the appropriate state, e.g., the "Top" state would return a "Top" state if given "up()" and a "Bottom" state if given "down()". All the code you design must be written out as Java source, with comments.

The other Design Pattern question: This question will give more detailed instructions about writing code for one of the Design Patterns we've already discussed in the course.