repository - Persistent Command pattern -


What am I trying to achieve, a continuous list of "invisible" changes on a permanent storage Is for / P>

For architecture domain objects and transactions for the unit of work and for the last part (undo) I thought about using the command pattern. However, there is no executed solution for me to see how the executed command can be maintained.

Actually, add / update / delete 3 write-work on the repository and command pattern will need to be stored before order was executed before order. For example: before I delete it, the domain object must be archived, so that it can be restored once it is reverted to the command. The big question is how to clean the state in a clear way!

It may be that none of you came in the same question which is not uncommon in my mind.

Thanks, Chris

Various methods that I have found:

  1. Store the full domain unit before the change. This may require a complex schema design and object-relational mapping.
  2. To store old values, use an additional set of tables to store the full domain unit before the change.
  3. The entire domain changes before the unit and stores it as a blob or XML string.
  4. Store this change in the domain unit, as the undo operation can be made from the change. If you can add and update complicated object graphs, then you still need a way to archive changes.

Comments