views:

27

answers:

1

We are designing a system and one of our requirements is to be able to record various events which are enacted on our domain entities as they pass through their lifecycle. A bit of me thinks we should store all these events as "Command" pattern objects with associated metadata (actor, date/time etc.) but this is based on my having used it to implement Undo/Redo in the past which is not a requirement here. We also have the added complexity that some actions act across multiple entity types and others are more discreet.

Does anyone have any experience of this? Is the use of Command appropriate or is there a simpler way to do this?

TIA

+5  A: 

Instead of storing the events enacted, an alternative may be to archive the past object states.

ChrisW
Interesting, is there a pattern I can refer to so I can try and model this?
Andrew Harmel-Law
Momento http://en.wikipedia.org/wiki/Memento_pattern
slf
Cheers, I just found this in my GoF book while I clicked "refresh". Thanks. ;-)
Andrew Harmel-Law