Aspect-oriented Python?

Martin Kew Martin.Kew at vsl.com.au
Mon Jul 3 01:27:11 EDT 2000


After seeing the following email, I investigated the Aspect Oriented 
Programing (AOP)
as well.  I to think that the Python language people should have a look at it.

In summary an "Aspect" is a property/function of a system that cannot be 
cleanly
encapsulated by a traditional programming language, for example:

a) loop fusion and resource sharing for procedural algorithmic code,

b) network traffic minimization, synchronization handling and error handling
for distributed client/server systems.

An aspect is captured using an "aspect language" in terms of  "crosscuts"
which are the connection points into the traditional program. ie. the loop 
construct
for a loop fusion aspect.

An AOP implementation of a system consists of:

a) using a traditional language (called a component language) define and 
program
the components of the system, ie. procedures, objects etc. Call it a "component
program".

b) using an aspect language define all aspects that will be applied in the 
system in
terms of  "cross-cuts".

c) "weave" all "aspects" into the "component program" using an "aspect weaver"
compiler to form a tangled "aspect program".

For example, for the fusion of loops in an image processing system, there was a
(35213-756)/352 = 98 reduction in code bloat for the incorporation of loop 
fusion.

raw component program (LOC) ie. without loop fusion = 756
hand implemented code incorporating loop fusion (LOC) = 35213
all aspect programs (LOC) = 352

This information was unashamably paraphrased from "Aspect-Oriented Programming"
G Kiczales et.all of Xerox PARC in "European Conference on OO Programming" 
June 1997
available a www.aspectj.org

The reason for presenting this overview was the overwelming lack of 
interest in the first
email by Cees de Groot.


At 09:29 pm 29/06/00 +0200, you wrote:
>I've been reading on aspect-oriented programming a bit, and it sounds really
>interesting. A Java implementation, AspectJ (www.aspectj.org) looks promising,
>but has the drawback that it only supports static weaving (wouldn't know
>how to do dynamic weaving with Java, so it's not a big surprise).
>
>With Python, experimenting with aspect-oriented stuff would probably be
>way easier, because it is easy enough to replace class methods etcetera. I've
>tried Google, but didn't find anything. Is someone busy with aspect-oriented
>programming for Python?
>
>--
>Cees de Groot               http://www.cdegroot.com     <cg at cdegroot.com>
>GnuPG 1024D/E0989E8B 0016 F679 F38D 5946 4ECD  1986 F303 937F E098 9E8B
>Forge your CipherSaber and list it: http://www.xs4all.nl/~cg/ciphersaber/
>--
>http://www.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list