Monday, November 19, 2007

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.

No comments: