[ZODB-Dev] Class Versioning?

Jim Fulton jim at zope.com
Sat Oct 29 17:26:03 EDT 2005


Lennart Regebro wrote:
> On 10/29/05, Chris Spencer <gmane.20.evilspam at spamgourmet.com> wrote:
> 
>>Would it be possible to support some system of class versioning in ZODB,
>>to aid to handling modifications to source code? For instance, suppose
>>each class definition has a __version__ attribute. Upon serialization,
>>this version is saved for each instance. Then, if the class is updated,
>>signified by incrementing the class's __version__, ZODB could take
>>action, for example, by executing an optional __upgrade_to_x(self) in
>>the new class definition.
> 
> 
> I don't see what benefits that would bring. It's quite easy to
> implement something like this on an application level. Also this
> doesn't allow for upgrades where you need to replace the object, which
> are not uncommon, so it's still not a complete solution.

Agreed.  For an example of such an application-level solution,
see:

   http://svn.zope.org/Zope3/trunk/src/zope/app/generations/README.txt?view=markup

Note that even though this package is in zope.app, the solution is quite
general and should be usable outside of Zope.  (This package really should be
lifted up a level.)

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the ZODB-Dev mailing list