tags:

views:

139

answers:

4

The requirement is to track all changes made to an entity, track it to know who did it, when he did, etc. For example, I have a Person entity, and a user has change the name of the person, I'd like to keep that information somewhere.

What's the best approach for this? Or is there an existing framework to achieve this.

I know that SQL 2008 has support for tracking changes, but it's not an option for now, because alot of our customers are already using sql 2005.

Is the Loogging Application Block of Enterprise Library a good candidate for this requirement? I've check it out a little bit but, I don't see how I can use it to track the who did it, what value has change, when he did it, etc.

We are using C# and .net framework for our app.

+1  A: 

have a look here

Ren Hoek
+1  A: 

Standrad way is to use events from INotifyPropertyChanging and INotifyPropertyChanged interfaces. And for collections INotifyCollectionChanged. Once you subscribed to this events you can store information wherever you want.

If you using MSSQL you can try Query Notifications

Trickster
A: 

Some sort of AOP solution (like the one in enterprise library) should provide you with enough possibilities to create such a solution.

You can subscribe to a property-invoke method and log the information.

Jan Jongboom
what's AOP solution?
pdiddy
AOP stands for Aspect-Oriented Programming.
Ronald Wildenberg
You would have an aspect representing changes to your business objects. You can define the function that has to be invoked when changing a property. Therefore you can add logging in your business code, so not only when doing the database query but also when just being in your business layer.
Jan Jongboom