with the commands is saved but also the number of undo levels can be determined of the maximum length of the list. Memento pattern With memento pattern the internal state of an object is stored. The object in which the state is saved, is called memento and is organized through the memento originator. This returns a memento, initialized with information of the current state, when undo is executed, so that the state can be checked. The memento is only visible for the originator. In memento pattern the undo mechanism is called caretaker. It is responsible for the safekeeping of the mementos but never change the contents of these. For undo the caretaker requests a memento of the originator and then applying the undo. The most part of undo mechanism can implemented without dependency to specific applications or command classes. This includes "the management of history list, the history scroller, menu entries for undo and redo and update of the menu entries depending on the name of the next available command." Every command class has a do method which is called when a command is executed. The undo-method implements the reverse operation of the do-method. To implement the reverse, there are several different strategies. full checkpoint: That means that the complete state is saved after a command is executed. This is the easiest implementation, but is not highly efficient and therefore not often used. complete rerun: Therefore, the initial state is saved and every state in the history list can be reached through "starting with the initial state and redoing all commands from the beginning of the history." partial checkpoint: This is the most used strategy. The changed application state is saved and with undo the part of the state is set back to the forward value. inverse function: Inverse function needs no saved state information. "For example, moving can be reversed by moving the object back by relative amount." For selective undo there is not enough information for saving the state. See also Reversible computing Rollback (data management) Undeletion Version control (native file format) References External links The Age of Undoing - Article about the linguistic history of Undo at The New York Times Magazine. Cascading undo control - a paper focused on what is cascading undo and how it might be presented to users Text editor features Reversible computing Computer-related introductions in 1968