how to implement undo/redo operation without major changes in program

pieere picture pieere · Oct 20, 2010 · Viewed 8.1k times · Source

Hi I'm about to add new functionality to application which I'm currently writting. I need to write a undo/redo fnctionality. However 90% of our application is ready and I don't know what is the best way to implementing this functionality without affectig(too much ) code which has been already created.

Answer

Reed Copsey picture Reed Copsey · Oct 20, 2010

There aren't many details here. However, Undo/Redo functionality is typically handled via some variation of the Command Pattern. Depending on your architecture, this could be a simple reworking of your basic functionality into "commands", or a major overhaul.