What are some design patterns for keeping a history of an object as it changes. I don't need anything as heavy duty as event sourcing, just the ability to save past versions when a specific event happens (in this case when a print form button is pressed).
Thanks, I forgot all about that one!
George Mauer
2009-02-24 20:08:30
Less is more. Very nice indeed.
JMD
2009-02-24 20:17:10
+2
A:
This sounds isomorphic to tracking undo information. The usual pattern for this is a variant of the Command pattern: you keep a queue in time order of previous states, with an operation to restore to the previous state.
Charlie Martin
2009-02-24 20:06:21
I was going to write an answer to this question, but you covered every point I wanted to make.
Jekke
2009-02-24 20:11:45
The difference is that the history itself is persisted whereas with undo info you don't need anything of the sort.
George Mauer
2009-02-24 20:15:40