[ZODB-Dev] ZODB migration to Zope 2.8

Dieter Maurer dieter at handshake.de
Sat Feb 12 13:47:09 EST 2005


Christian Heimes wrote at 2005-2-12 01:16 +0100:
> ...
[JF]
> > Another idea might be to define some sort of protocol
> > for dealing with unrecognized classes.  When the database
> > encounters a class it doesn't recognize, it could look in a table for
> > a handler.  That handler would be responsible for creating a new object.
> > Perhaps this could be combined with some sort of database conversion
> > process.

[CH]
>That sounds like a great idea! A dict like registry would be sufficant:
>
>   { 'full.dotted.path.to.class' : callable, }
>
>where callable is a callable like:
>
>   newObject = callable('full.dotted.path.to.class', state)

The problem is probably larger:

  The class information is not only coded in the object (state)
  itself but also in the persistent references to this object.

  When we change the object state to use a new class (and
  fix the persistent reference we used for the access)
  all other persitent references are still wrong.

  When we later follow such a reference, we must not
  try to convert the object a second time.

-- 
Dieter


More information about the ZODB-Dev mailing list