I'm working on creating a transparent auditing system whereby methods can be flagged 
for auditing using attributes and the system, implemented in the object or the object 
base class can process audit information.

The approach that I've taken thusfar is to create a custom attribute (basically data 
only), and create a base class that goes through the type information to determine 
which methods are flagged for auditing.

My thought at this point is to, when a method is found that requires auditing,  append 
a line of code to that method (calling a _WriteAudit_ method) and immediately 
recompile.  In the Reflection.Emit namespace, I can see how I could build methods from 
scratch -- however, I don't see how to edit a method.

Also, concerned about the performance implications of this approach -- especially if 
there is a more standard approach for accomplishing my aforementioned goal.  thoughts?

_howard

Reply via email to