AOP use cases

Adrien Di Mascio adim at nospam.com
Fri Apr 16 12:20:16 EDT 2004


Le Fri, 16 Apr 2004 17:22:08 +0200, Daniel Dittmar a écrit :

> Not from personal experience, but these have been mentioned:
> - multithreading
> - persistence
> - transactions
> It may very well be that these can be implemented in current Python,but
> this only means that Python already has good support for AOP.
All the examples you mentioned can be implemented in Python.
Maybe we could also add "profiling", "security" ...

IMHO, what's great (in this context) with Python is that it's possible
to weave code (or adapt code) dynamically wherever you want quite
easily. And that's (*only*) a part of AOP. Doing this by using
metaclasses, PEAK aspects, Pythius aspects, Logilab aspects, etc. this
does not really matter.

I think, and I might be wrong since I'm still a bit new to AOP, that
there is nothing that you can do with AOP that you could not do with a
plain OO program. (And any OO program could also be written in a non
object-oriented way). But AOP is here to let you improve reusability by
giving some new ways to factorize code. Someone in this thread (I think
it is Hung Jung Lu) defined AOP as being a kind of Fourier Transform of
OOP, and I like this way of defining it.

Cheers,
Adrien.




More information about the Python-list mailing list