mark-p-thomas : Command History

This class records the history commands of associated with a particular index. It utilized the Command Pattern from the Gang of Four. This class holds a list of commands for multiple indices, allowing either one global state to track, or separate states, say, associated with one index per object of interest.

Benefits of using this library are its flexibility in tracking 1 or multiple states, as well as small memory requirements. A downside is that it requires more time is required, as each state must be recreated. Also, fidelity of the recreated states is dependent upon the the quality of the reversing commands created externally. Basically, time complexity is equal to that of the reversing command for retrieval, and space complexity is O(n) , for n commands saved.

Class Diagram

Operations

Undo/Redo

ExecuteCmd

Example Code