Definition of Aspect Oriented Programming

Kyle Yancey kyle at lakeofburningfire.org
Thu Jun 19 10:03:53 EDT 2003


In any program there will be small recurrent tasks that are spread out
over your entire code base.  These tasks can't be modularized in the
current programming paradigm.  The typical examples are logging or
user authentication.  Although you can obviously create classes for
these tasks and place them in modules, they will be used throughout
your entire code base.  You might say that they are sandwiched into
your code.  Any change to this code will leave you doing a hunt
through your entire code base.  Aspect Oriented Programming allows you
to write modules specifying where these tasks need to be sandwiched in
and performs this "weaving" at compile time.  This is my simple
explanation, but I hope that it has helped.

For those who are interested, aspect oriented programming is available
in python through the use of metaclasses.  Pythius contains an Aspect
Oriented module with a similar interface to aspectj.  I personally
find this much better than transwarps.
http://pythius.sourceforge.net/

If I've not been clear enough, I apologize.  I'm rather new to this
concept myself.


On 17 Jun 2003 19:54:42 -0700, aeze616 at cse.unsw.edu.au (anson) wrote:

>Dear sir,
>
>    What is aspect oriented programming? I read a little bit about
>AspectJ. It seems to me that its like...some kinda, new syntax that
>ain't related to the original Java language. How do it work in
>general?
>
>regards,
>
>zeallous





More information about the Python-list mailing list