in reply to Undo Operations
The only discussion I have seen of this feature is the Gang of Four book on Design Patterns. They call it the "Action Pattern" there, and the idea is quite simple :
In your program, you have (named) actions, that the user can execute, for example in Word, insert a character, insert a word, insert a range, delete a character, delete a word, delete a range. Cutting and pasting text can be modeled as deleting and inserting of several words and characters. Every Action is put into a list, which will be called the "undo list" for obvious reasons. Now, inverting an action is very simple for insert and delete actions, and if you take an object oriented approach, you can simply make it that every action knows how to undo itself.
These actions must be wedged inbetween the model and the controler if you have an MVC approach. If you don't have an MVC approach, I have no idea how you will find all the possible locations where you need to put special registering code.
Note that the undo list and the code needed for it also makes your application very easily scriptable, as a script is nothing more than a saved "do"-list - you just need a way to tell your actions whether they should do or undo themselves.
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
|
|---|