Hi all,
what I am trying to achieve is to have a persistent list of "undoable" changes on a persistent storage (database).
The architecture employs repositories for the domain objects and Unit of Work for transactions and for the final part (undo) I thought of using the command pattern. However, for me there seems no good solution how to make the executed command persistent.
Basically, there are 3 write-operations on repositories add/update/delete and with the command pattern I would need to store the state before the command was executed. For example: I have to store the domain object (entity) before I delete it so that I can restore it once the undo is called on the command. The big question here is how to store the before-state in a neat way!
Maybe someone of you guys came across the same question which in my mind is not that uncommon.
Thanks, Chris