.NET AOP

From Richard's Wiki
Jump to: navigation, search

.NET Aspect Oriented Programming Frameworks

Surveys of .NET AOP Frameworks

# Approach Advantages Disadvantages
1 Remoting Proxies Easy to implement, because of the .Net framework support Somewhat heavy weight, Can only be used on interfaces or MarshalByRefObjec
2 Deriving from ContextBoundObject Easiest to implement, Native support for call interception Very costly in terms of performance
3 Compile-time subclassing ( Rhino Proxy ) Easiest to understand Interfaces or virtual methods only
4 Runtime subclassing Castle Dynamic Proxy ) Easiest to understand, Very flexible Complex implementation (but already exists), Interfaces or virtual methods only
5 Compile time IL-weaving ( Post Sharp / Cecil ) Very powerful, Good performance Very hard to implement
6 Runtime IL-weaving, ( Post Sharp / Cecil ) Very powerful, Good performance Very hard to implement
7 Hooking into the profiler API ( Type Mock ) Extremely powerful Performance?, Complex implementation (COM API, require separate runner, etc)