Damons Laboratory
    The most exciting place on the internet!


A Science & Engineering OnLine Laboratory Notebook   
This is the laboratory notebook of Damon Bruccoleri.  Here you will find engrossing, thoughtful and fun commentary/opinion.  Leave a comment and let others know what you think about any post here, or view my photo gallery.

New is my list of developed products accessible from the top tab.

"...one of the strongest motives that lead men to art and science is escape from everyday life with its painful crudity and hopeless dreariness, from the fetters of one's own ever-shifting desires. A finely tempered nature longs to escape from the personal life into the world of objective perception and thought." - Albert Einstein


Latest Notebook Entries

 Tuesday, June 26, 2012


Undo/Redo   
Undo-icon.pngA software concern that I recently investigated was Undo/Redo.  An OOP programmer tries to use design patterns as a tool for recognizing software patterns that repeat themselves from project to project.  As an engineer or programmer we all come to recognize these recurring design patterns.  These patterns are abstract.  They help us to see seemingly different projects as having common threads.  Once we recognize them they help us to do our job quicker and possibly more thoroughly.

There are two design patterns I looked at for implementing an Undo/Redo facility for a software project.  Both require an Undo stack and a Redo stack.  As the user executes commands in the target program the commands are put on the Undo stack.  If the user un-does an operation, that operation is then put on the redo stack.  

The first method I investigated was to use something like the command pattern to create a central mechanism for each user operation.  The problem is that each command would need its opposite command for the undo operation.  Not many operations are reversible.  This would mean the operations presented to the user would necessarily be limited to reversible operations.

damon undo-redo copy.gifThe second method, the method I chose to implement, was to save the state of the software at each step.  A design pattern that can implement this functionality is the Memento design pattern. 

The Undo/Redo software concern can be demonstrated to be a cross-cutting concern.  That is this concern is highly coupled with the other aspects of the target program.  As such I additionally demonstrated an Aspect Oriented (AOP) approach to modularization of this concern.

Link to report


damon at 8:35 PM |
(0) Comments | Add a comment | Permalink





Commments

  Leave a comment

Enter Your Name:
 
Enter your website
Security code from image below:  
Need Custom Controls Work or Training?