Look At AOP : Getting Rid Of INPC Using Aspects

Some of you may know me, and know that I am quite into WPF, some of you may even be into WPF yourselves and come to my blog to see what posts I have here to do with WPF.

Well I just released a new article all about Aspect Orientated Programming (AOP).

I looked at 4 different AOP frameworks:

Castle

Unity

PostSharp

LinFu.AOP

Now as a WPF developer I use the INotifyPropertyChanged interface (INPC) an awful lot.

I have to say a lot of the time I am merely checking the new value does not equal current value and then calling the INotifyPropertyChanged interfaces PropertyChanged event. Not all the time mind, there are cases where something different happens in the setterâ€¦.but 80% of it is bulk standard, check property and call PropertyChanged changed event.

Now I got thinking if we could use AOP to come up with something like this, where we use some special attribute to mark standard auto properties as INPC, where the AOP framework would fire the INPC PropertyChanged event whenever a property marked up with one of these attributes was set.