Field interception required


In order to implement change tracking for POCOs, I want to track when a field value (not a property!) has been set. For the change tracking I need static and dynamic weaving.
Closed Feb 3, 2013 at 9:15 PM by wschult
See last comment.


wschult wrote Sep 18, 2012 at 9:22 AM

LOOM has a feature called join-point variables that allows for accessing protected and public fields from your aspect code. Despite other AOP frameworks we explicitly do not support interweaving of field accesss for several reasons. The most important is that a field is a passive artifact of an object. If you would allow that one can interweave a field, the behaviour changes from passive to active.
I your case, a clean solution would be that you declare an advice that interweaves all possible methods/properties. Within the advice you can access the objects state and track changes after the call returns. Alternatively you could encapsulate fields into properties and interweave these.

wrote Sep 18, 2012 at 9:23 AM

wrote Feb 3, 2013 at 9:15 PM

wrote Feb 14, 2013 at 6:16 PM

wrote May 16, 2013 at 8:10 AM