I think undo is very application specific. The most brute force way to do undo is to keep multiple snapshots of your data (one for each undo level). For large databases, this isn't feasible so I would suggest keeping a log of changes made to the database after each action.
For example, if your contact list initially contains A,B,C,D,E, then you decide to add F, delete B, and change C to G. Your undo log would look like this:
1. insert F at position 5
2. delete B from position 1
3. change C to G at position 2
To undo, you just use the information in the log to backtrack.



LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks