Memento Pattern Ex

advertisement
Memento Pattern: Reverting State
Changes
Aim of this exercise is to familiarize yourself with the following pattern:

the memento pattern
You'll find the templates of the classes in archive dp-memento.zip. Unzip the
archive.
Introduction
Find the code skeletons for a simple, table-based application:



Class ScheduleGUI: The main program that constructs the GUI. It acts
also as caretaker.
Class ScheduleTableModel: a subclass of DefaultTableModel that stores
the data of a table.
Class TableMemento: a memento class for tables.
Tasks
Provide the following improvments:
1. Complete the classes ScheduleGUI, ScheduleTableModel,
and TableMemento.
2. Refactor the application such that the memento class becomes an inner
class of ScheduleTableModel.
3. Add a "Save as.." feature to the application that allows to save the
memento object in a file. Add also a "Load.." feature to the application,
of course.
Download