AOP use cases

Tor Iver Wilhelmsen tor.iver.wilhelmsen at broadpark.no
Sat Apr 24 13:32:47 EDT 2004


Peter Hansen <peter at engcorp.com> writes:

> I would be very interested to hear some real-world and real useful
> use cases for AOP as well.  So far, the logging example seems to
> be put forth so often that I'm starting to suspect that's the
> *only* "useful" thing people are doing with it. :-)

A couple of other examples:

- Implementing Singleton as an aspect which states that calling
  set*(self, value) methods on a set of classes should raise an
  AttributeError - or just do nothing
- Measure execution time of a method by wrapping an aspect-"advice"
  around it

An AOP mechanism for Python i googled up:

<URL: http://cvs.sourceforge.net/viewcvs.py/
 pythius/pythius/pythius/aop.py?rev=1.36&
 content-type=text/vnd.viewcvs-markup >



More information about the Python-list mailing list