AOP

Published Wed, Jun 30 2004 23:31 | girishb
I read some take on AOP by William here and I read some more at Ericgu's blog.

Since then, I have been thinking about what AOP actually buys to a programmer. The biggest advantage of AOP has been modification of behavior without affecting the actual code. But then, you can achieve similar result by deriving your class from that base class and implementing pre/post/instead-of processes. This is very cool. But, can you imagine the pain it introduces if not controlled? If you think of OOP as being Communism where every "object' has a role to play in the "state", AOP is like introduction of capitalism to USSR. If not controlled properly, it can easily ruin the "state". Considering .NET already provides most mechanisms needed to implement AOP implementation(such as reflection), I believe, .NET should not go about implementing it from within. It can be similar to the "Power collections" initiative by Brad where some other community site takes up the responsibility of implementing the correct infrastructure needed for this.

Comments

# girishb said on July 1, 2004 6:17 AM:

The issue I have with not having AOP implemented as part of .NET is that the performance implications of any other implementation (other than pre-compiled static aspect weaving) are pretty horrific.

# girishb said on July 1, 2004 1:58 PM:

I accept that. But, I am just not sure if its something the .NET framework should do or bless it as a 3rd party implementation.

# girishb said on July 1, 2004 7:47 PM:


There are many things that can be done that way, but this kind of behaviour really requires the runtime and compilers to do something. Collections are just additional classes - I wouldn't think it needed runtime or compiler behaviour changes.
In my opinion, we dont actually need the full static, dynamic weaving solutions. Personally, I just want more power in Contexts (where we could achieve a similar result), but even that is hard without stumbling into areas, the runtime could do easily for you. Do we really want different 3rd party compilers - one that does aspect weaving, another generics, another something else?

# girishb said on July 1, 2004 9:33 PM:

I know that having multiple compilers can be a pain in the arse. Probably Contexts or something similar can be better off. Of course, If runtime starts allowing it, that means we need lot more control for the sake of both security and for clarity of behavior.

# girishb said on July 8, 2004 1:02 PM:

the problem with using a base class approach is that AOP is about cross-cutting concerns. this means they can affect all classes that may or may not be part of the same object heirarchy. by putting it into the base class you are going down the path of creating a brittle framework. this means you have the static implementation (change the compiler) or the dynamic implementation (interception).

however a good dynamic implementation would require hooks in the framework that you can leverage. either way, a change to the framework is required (caveat: there are some good dynamic implementations that negate some of this but for it to be truly accessible to the masses you need to affect the framework...imho).

-Mathew Nolton

# girishb said on September 22, 2005 11:26 PM:

Teddy's Aspect Weaver (Static IL level weaving)

http://www.cnblogs.com/teddyma/category/36167.html

Search

This Blog

Tags

Community

Archives

Personal

Blog roll

Syndication

Email Notifications