Difference between revisions of ".NET AOP"
From Richard's Wiki
(New page: == .NET Aspect Oriented Programming Frameworks == * [http://www.postsharp.org/ PostSharp] (compile-time aspect injection (good), but LGPL or commercial license (bad)) * [http://msdn.micros...) |
(→.NET Aspect Oriented Programming Frameworks) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
* [http://msdn.microsoft.com/en-us/library/cc511729.aspx Policy Injection Application Block] (pseudo-AOP framework, runtime aspect injection, from Microsoft P&P group, getting old...) | * [http://msdn.microsoft.com/en-us/library/cc511729.aspx Policy Injection Application Block] (pseudo-AOP framework, runtime aspect injection, from Microsoft P&P group, getting old...) | ||
* [http://www.springframework.net/doc-latest/reference/html/aop.html Spring.NET] (Runtime aspect injection via proxies) | * [http://www.springframework.net/doc-latest/reference/html/aop.html Spring.NET] (Runtime aspect injection via proxies) | ||
+ | ** [http://www.codeproject.com/KB/architecture/AOP_UsingSpringPart1.aspx AOP Using Spring.NET - Part 1] (CodeProject, June 2008) | ||
+ | ** [http://www.codeproject.com/KB/architecture/AOP_UsingSpringPart_2.aspx AOP Using Spring.NET - Part 2] (CodeProject, June 2008) | ||
== Surveys of .NET AOP Frameworks == | == Surveys of .NET AOP Frameworks == | ||
* [http://csharp-source.net/open-source/aspect-oriented-frameworks Open Source Aspect-Oriented Frameworks in C#] (CSharp-Source.net) | * [http://csharp-source.net/open-source/aspect-oriented-frameworks Open Source Aspect-Oriented Frameworks in C#] (CSharp-Source.net) | ||
* [http://www.codeproject.com/KB/cs/AOP_Frameworks_Rating.aspx Rating of Open Source AOP Frameworks in .Net] (CodeProject Aug 2008) | * [http://www.codeproject.com/KB/cs/AOP_Frameworks_Rating.aspx Rating of Open Source AOP Frameworks in .Net] (CodeProject Aug 2008) | ||
+ | * [http://www.neovolve.com/post/2009/04/08/Styles-of-AOP.aspx Styles of AOP] (Has a useful table of AOP immplementation methods, reproduced below:) | ||
+ | |||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! # 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) | ||
+ | |} |
Latest revision as of 02:02, 23 July 2009
.NET Aspect Oriented Programming Frameworks
- PostSharp (compile-time aspect injection (good), but LGPL or commercial license (bad))
- Policy Injection Application Block (pseudo-AOP framework, runtime aspect injection, from Microsoft P&P group, getting old...)
- Spring.NET (Runtime aspect injection via proxies)
- AOP Using Spring.NET - Part 1 (CodeProject, June 2008)
- AOP Using Spring.NET - Part 2 (CodeProject, June 2008)
Surveys of .NET AOP Frameworks
- Open Source Aspect-Oriented Frameworks in C# (CSharp-Source.net)
- Rating of Open Source AOP Frameworks in .Net (CodeProject Aug 2008)
- Styles of AOP (Has a useful table of AOP immplementation methods, reproduced below:)
# 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) |