[ZCM] [ZC] 239/ 1 Request "Product Re-Factoring Impossible"

Collector: Zope Bugs and Patches ... zope-coders@zope.org
Thu, 21 Feb 2002 20:11:44 -0500


Issue #239 Update (Request) "Product Re-Factoring Impossible"
 Status Pending, Database/bug critical
To followup, visit:
  http://collector.zope.org/Zope/239

==============================================================
= Request - Entry #1 by Anonymous User on Feb 21, 2002 8:11 pm

We are currently re-organizaing our code base and have existing production sites using this code base we will need to update in the future. The ZODB provides no mechanism for updating the pickled objects to refer to the new layout. After the change, any existing site returns a slew of errors such as:
 
2002-02-21T22:26:36 PROBLEM(100) ZODB Could not import class 'MembersApp' from module 'Products.DotOrg.Members.MembersApp'
 
I've read through the mailing list archives and any other docs I could find. They suggest __module_aliases__ which I've tried. It helps but doesn't work with classes which are very common. I've tried many other things like manually assigning the __class__ attribute and using a custom persistent_load() method. 
 
There either needs to be a tool for this or some documentation on massaging existing code to get the module_aliases trick to work (change class reference to module references in the pickled objects).
 
This is critically important to the long term viability of Zope and any products built on Zope. If you can't restructure your code as it grows, it eventually becomes un-maintainable. 

==============================================================