Welcome to MSDN Blogs Sign in | Join | Help

Lack of Aspect Oriented Programming support in .NET

I was preparing for a presentation on Aspect Oriented Programming and I started re-looking for the solutions in .NET.

I'm personally not interested about any of the dynamic methodologies, be it dynamic weaving or any other form of dynamic proxying. To me CLR is static-typed and I'd want any solution to be the same (on DLR I'd definitely accept a dynamic solution). Predictability, performance, debugability are  major concerns that are not well addressed in dynamic methodologies. Some of the Dynamic approaches also have special requirements like they can only support virtual methods as join-points.

To me the perfect AOP solution on .NET would either be an IL weaver which ships as a post-compilation tool or an extension language. AspectDNG and EOS are good example for the two approaches respectively.

Wikipedia had a bunch of links and I tried couple of them. It seemed like most of the tools uses dynamic approaches and had the same issues mentioned above. From the static tools I tried AspectDNG's IL weaver. Even though the weaving was good it didn't update the pdb files resulting in very poor (or no) debugging experience. I tried EOS and liked it a lot. However, the project seemed to have died with no updates for a long time.

I think something serious needs to happen in this space. Either Microsoft or some other large body (serious open source project ?) needs to pick AOP up to make it successful in .NET. To me the tool of choice would be extension to the C# language in the same lines as EOS (or AspectJ).

There seems to be already some work going on like the Policy Injection Application Block which works over .NET remoting.

Cross posted at my personal blog

Published Tuesday, November 20, 2007 10:42 AM by abhinaba

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Developer News » Blog Archive » Stop the insanity: SCCM and WS2008 beta examsSystem Center Configuration

# re: Lack of Aspect Oriented Programming support in .NET

Tuesday, November 20, 2007 5:18 AM by Ayende Rahien

Did you check projects such as Windsor?

It has interceptors capabilities that makes it much easier to handle this types of things.

http://www.ayende.com/Blog/archive/2007/03/07/Building-the-Policy-Injection-in-40-Minutes-with-Windsor.aspx

# re: Lack of Aspect Oriented Programming support in .NET

Tuesday, November 20, 2007 5:55 AM by abhinaba

IMO Interceptors don't work that well. For interceptors to work you need to either change your inheritance tree (so that you inherit from ContextBoundObject) or else some dynamic IL weaving is done which fails in a bunch of scenarios. E.g. only Virtual calls are supported.

# re: Lack of Aspect Oriented Programming support in .NET

Wednesday, November 21, 2007 5:33 AM by Ayende Rahien

Then I fail to understand how you point out the policy injection block as progress.

Yes, I would _very_ much like it if the platform has builtin ability for interception.

Remoting proxies are close, but we need to remove the requirement for MarshalByRefObject

# re: Lack of Aspect Oriented Programming support in .NET

Wednesday, November 21, 2007 9:03 AM by abhinaba

I said "There seems to be already some work going on like the Policy Injection Application Block which works over .NET remoting."

Some work going on doesn't mean that its in the right direction :). To be fair the work is going on in another team which I'd guess doesn't have the ability to change .NET or C# in their own way.

# re: Lack of Aspect Oriented Programming support in .NET

Saturday, December 01, 2007 3:11 AM by zproxy

There is a project called "postsharp" that can do AOP for .net.

http://www.postsharp.org/

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker