[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Aspect Oriented Programming in context of lightweight languages.



At 10:49 AM 3/19/2003 -0800, Michael Vanier wrote:

>> Date: Wed, 19 Mar 2003 14:46:00 +0100
>> From: Pascal Costanza <costanza@iai.uni-bonn.de>
>> 
>> Matthew Estes wrote:
>> >     I've been reading on Aspect Oriented Programming for a while, and I 
>> > was having a hard time getting my head around it. On the surface, it 
>> > seems useful to me, but it seems everyone loves the "adding logging to 
>> > an application example", and other problems solved by it aren't just 
>> > busting out of my head.
>> 
>> You could rightfully say that AOP is a continuation of the work that had 
>> been done in the context of Common Lisp's metaobject protocol (MOP). 
>> After all, Gregor Kiczales, who coined the term aspect-oriented 
>> programming, also worked on the MOP.
>
>I read somewhere (perhaps in an interview) where Kiczales said that CLOS
>was too powerful for most programmers to make good use of, and AOP was his
>attempt to simplify the underlying ideas and make them accessible to more
>programmers.  I'm paraphrasing; if anyone finds the original source, please
>post a link.

I don't know anything about such a quote, though CLOS (which is pronounced "Common Lisp") has some features that are similar to AOP, which make it a useful programming language.  You could think of before, after, and around methods as "advice", but you can only advise one method at a time.
In AOP you can add advice to many places in the code (not just methods) at once.  Also, in Common Lisp, you could program either at the base level, or at the metalevel, and easily expose metalevel details to functions like (describe).  AOP does not have a metalevel.

In AOP, you can make statements that describe the dynamic execution state, such as "when a call from any method outside my package calls a method in my package do ...".

I think it's fair to say that Common Lisp was a predecessor to AOP.
AOP is another dimension lightweight languages should explore.

That said, AOP is like continuations or multiple inheritance.  It may be nice to have, but most people have learned to live without them.  Are they worth adding to a language if they are only used about 15% of the time?
Maybe we have a lot of unlearning to do before before we can make progress.