[PEAK] ObjectRoles (aspect objects) now available on the Cheeseshop

Phillip J. Eby pje at telecommunity.com
Thu Jul 12 13:45:39 EDT 2007


The "aspects" stuff I announced a couple of days ago is now available 
for download from the CheeseShop, as the "ObjectRoles" package:

    http://cheeseshop.python.org/pypi/ObjectRoles

It implements aspect objects, including all the nice class decoration 
features I described here:

    http://www.eby-sarna.com/pipermail/peak/2007-July/002723.html

Except that the objects are called Roles instead of Aspects, and I 
decided not to add it to DecoratorTools, mainly because it needed so 
much doc, tutorial, and tests of its own that it would have 
unbalanced the DecoratorTools documentation.

In any event, if you use this in combination with PEAK-Rules, you get 
about 2/3rds of AspectJ-like capabilities in Python: "advice" and 
"introductions", but not pointcuts.  (That is, you can't assert 
advice over a collection of functions/methods; you have to do it one 
method at a time.)

Anyway, enjoy!  I intend to use this to implement the Trellis API 
next, and there is some possibility I might later refactor some PEAK 
core bits to use Roles instead of a bunch of messy class attributes 
managed by metaclasses.  (Hm, can you say "messy metaclass managed 
attributes" five times fast?)  But I'm not in any hurry to do that at 
the moment.  (The refactoring, not the tongue twister.)




More information about the PEAK mailing list