Re: Is there a standard .Net Aspect software package?

"Roger Johansson" <[email protected]>
Newsgroups gmane.comp.programming.aspect.general
Message-ID <000f01c69095$4b67ab90$6400a8c0@MajaBaja>
If anyone want to try out NAspect but gets stuck due to sparse documentation please let me know :-)
Im currently working on the documentation and going to add more samples as soon as I get my thumb out..
(www.puzzleframework.com)

Regarding the lack of some standard approach for .NET:

I think this is quite different from how things are in the java world.
In the java world there is just java.
So when the AspectJ guys came along they could simply take java and create AspectJ.
And it could be used by any Java developer.

In the .NET world there is not one single language , there are C#, VB.NET , managed C++ and a gazillion other homegrown languages.
So making a specific language for AOP in .NET is (in my oppinion) the wrong way to go, since it would only be useful for a fraction of the .NET community, eg only C# developers.
It also requires quite a bit of work, developing an entire IDE, compiler and everything else that comes with it..

So (I think) the solution have to work with any language, then we have a few other approaches , code mangling and dynamic proxies.

Code mangling is powerful and could be applied to pretty much any .net assembly , compiled from any language.
Sadly code mangling comes with a few drawbacks, eg very hard to make a debugger for it, and without any debugger it will fall dead to the ground.

Dynamic proxies is less powerful than code mangling , but proxied code is very easy to debug, which is good.. 
But proxies come with some other drawbacks,  you have to create your instances via factories and you can only apply aspects to non sealed classes with virtual methods via interface proxies which also  comes with some severe identity problems.

So I can't say that any of the approaches are very good for .NET.
I used dynamic proxies in NAspect simply because it was enough for my own needs and Im not too keen on breaking OO rules, so inheritance based AOP was fine for me.. 
but Im well aware that it doesnt cover the needs of everyone else..

I think we might never get a common system for AOP unless MS decides to support interception and mixins (not extension methods) in the framework itself.

Untill then, I guess we have to pick the approach that fits our specific use cases the best..

//Roger

_______________________________________________
discuss mailing list    -    [email protected]

To unsubscribe and change options, go to:
http://aosd.net/mailman/listinfo/discuss_aosd.net

Check out the AOSD.net Wiki: http://aosd.net/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.