|
Now, I know this isnt strictly an NHibernate question, but it's what I'm using for implementation and this is the best forum I could think of to post to (mostly because I'd prefer an answer from someone with at least some knowledge of NHibernate).
One of the sites I am working on needs a lot of reports depending on various site events like user registration, user posted content, user deleted content, user modified content, user contacted another user, etc.
So, I simply made an Event object that has fields for EventType (see list above), Timestamp, User, and ItemID (to get back to whatever particular item the event refers to).
I'm not entirely sure this is a good solution, so I'm open for suggestions on how to enhance it and/or get rid of it and do something entierly different.
One such idea I came accross is called History Tables and basically what you do is have a corresponding history table for each table. The history table has all the same fields as the regular table except it adds on a change type field and a timestamp field. The possible change types are create, update, and delete. Then you just create triggers that do inserts into the history table whenever the regular table is modified, giving you a comple change history for every table.
Now, my problem with this solution is that it seems like overkill--I'm not really interested in collecting every chage in data, I'd rather just know that the change took place.
Any thoughts, suggestions, etc. would be appreciated.
_________________ Josh Coady
http://jlcoady.net/
|