Aspect Programming Module

John J. Lee jjl at pobox.com
Sat Apr 17 17:22:49 EDT 2004


Joe Mason <joe at notcharles.ca> writes:

> In article <407E394B.2050709 at mxm.dk>, Max M wrote:
> > Hung Jung Lu wrote:
> > 
> >> Python does not even have codeblocks. So how can you say AOP is not
> >> needed for Python programmers?
> > 
> > I am probably rather dense, but I have not seen aspect oriented examples 
> >   that could not have been done with simple mixins.
> > 
> > Isn't it needed in Java because it doesn't have multiple inheritance?
> 
> AOP is a design technique, not just a set of tools.  If it's true that
> you can just use simple mixins in Python to get the same effect as
> ApectJ, then you can say, "AOP is implemented on Python with mixins, but
> Java requires language extensions such as AspectJ."  That doesn't mean
> Python doesn't "need" AOP - nobody really "needs" it, they just find it
> a useful way of approaching problems, and moving to Python doesn't make
> it a less useful approach.  In fact, if it's easier on Python, it's more
> useful.

Joe is surely on the right trail here.

What I wonder, though, is: Is AOP just another set of design patterns
that often work nicely together, or do the ideas involved form a much
more unified whole than that description implies?  And is there a
significant break in thinking involved in moving from standard OOP to
AOP?

I listened to a introductory talk on AOP by Arno Schmidmeier yesterday
at the ACCU conference (Good talk: interesting, and I understood it --
in stark contrast to the stuff I'd read previously about it -- despite
Arno's suffering with a bad case of Powerpoint disease ;-).  I asked
him whether he knew of any usefully mature Python implementations.

Of course, the mostly-tacit assumption behind my question (driven no
doubt by the name's similarity to 'OOP') was that AOP is indeed (at
the least) a blob of concepts and design techniques that.are much less
useful apart than they are together.  More than that, in fact: that
doing AOP requires a significant change in the way you think about
design.  I wonder if that's true, or if it just appears that way to
the users of static languages?  Perhaps AOP is better regarded as
merely a bunch of design patterns that only appear to Java/C++ people
to be a new "paradigm" (in a very loose sense of the word) because of
the implementation techniques that those languages happen to force on
you when you try to implement these patterns.  I'm sure it's not that
simple, but maybe there's some truth in that suspicion.

Whatever the answer, I wish there were a reasonably 'standard' set of
AOP tools available for Python so I could find out by experiment.
Standard in the concepts rather than implementation techniques, that
is.


John



More information about the Python-list mailing list