[TransWarp] lifting class families into Zope

Daniel Mahler mahler at cyc.com
Fri Jan 17 17:59:28 EST 2003


Hi,

I wonder if TransWarp/PEAK offers any way
to automate the problem of Zopefying preexisting a class library.
ie given a set of classes say:
Animal,Mammal,Dog,Cat,BodyPart,Organ,Liver
create a Zope aware varsion of each class
such that the interfaces line up correctly
eg ZopeDog().liver would return an instance
of ZopeLiver rather than Liver.
The only Zope awareness I want for ZopeDog
is to inherit from some very
basic Zope class so that Zope can pass it around
and possibly put instances in folders.
This is a fairly mechanical change,
but seems to require a lot of coding,
even when using metaclasses and proxies,
since one must ensure that methods of lifted classes
return lifted objects.
The only "quick" way I see of doing it
is to create a separate copy of the file
which ensures that classes in it inherit from Zope classes,
but then I have created a split version of the library,
rather than a wrapper around the library.
It seems that something like Don Batory's idea of a mixin layer
is what I am looking for.

Daniel






More information about the PEAK mailing list