[Zope3-dev] persistence by adaptation, and aop?
Phillip J. Eby
pje@telecommunity.com
Tue, 03 Jun 2003 12:17:12 -0400
At 12:10 PM 6/3/03 -0400, Guido van Rossum wrote:
>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.
>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.