Brainstorming an undo-redo mechanism at work today and here are a couple of thoughts:
- There are so many mechanisms that already exist. A quick google on CodeProject gives five right away (without extra digging). NIH is foolish. :)
- Undo actions are transactions. However, they might not be just for your business objects, but also for your UI. An undo transaction might be only for the UI (but not likely).
- We've considered using Action/Reverse-Action, but this is double the code and development time. Reverse actions might also not be possible at times, since multithreading and events might cause non-deterministic action order.
- System.Transactions is nice, but it only works in one way – Undo. Creating a Redo with dual transaction directions might work, but it seems like a kludge.
- This article offers the closest solution to what we need, but it causes debugging pains and supports neither transactions nor UI element changes.
Anyone know of any good solutions?