[Zope3-dev] persistence by adaptation, and aop?

Guido van Rossum guido@python.org
Tue, 03 Jun 2003 12:32:41 -0400


> >Pickling is certainly a problem that looks like it would be better
> >solved with adapters than with the current mixture of hard-coded
> >knowledge (like the Pickler class) and special methods added to
> >classes (__getstate__ etc.).
> 
> Absolutely.  But I doubt it's really changeable before 3.0.

Maybe.  But if adapters make in in Python 2.x, using them for pickling
would not be far off.

> >I don't know how adapters relate to AOP though.
> 
> AOP is a rather broad field.  The "composition filters" and "object teams" 
> schools of AOP thought are mostly about adapters.  There are several 
> competing adapter-based AOP tools for Java at present, plus various similar 
> ones for Lua and Ruby.
> 
> 
> >One think to note is that he claims that persistence is declared about
> >an *object* -- not a class.  Adapters are still about classes.
> 
> Not at all.  At least, not in the adapter-based AOP schools and tools.  In 
> "Object Teams", adapters are used for "roles" that objects play in a 
> "team".  The same "base" object may be playing multiple roles 
> simultaneously, or the same role in more than one team.  These 
> relationships are definitely about individual objects, even though the 
> adapters themselves are defined by classes, and written with specific 
> object types in mind.

Cool.

--Guido van Rossum (home page: http://www.python.org/~guido/)