[Zope] Upgrading Zclasses

Rob Page rob.page@digicool.com
Thu, 22 Jul 1999 08:18:51 -0400


> -----Original Message-----
> From: Itamar S.-T. [mailto:itamars@ibm.net]
> Sent: Thursday, July 22, 1999 7:06 AM
> To: Zope-l
> Subject: [Zope] Upgrading Zclasses
> 
> 
> Let's say I create a ZClass and then distribute it to other 
> people, who then
> use it in their website.  If I make changes to the Zclass, 
> the instances get
> automatically changed, but if the other people using the 
> Zclass want to have
> my changes, ie. use the updated Zclass, how can they do so 
> and have their
> instances use it too?

I'll go WAAAY out on a limb here and explain what I think to be so (of
course I only learned these details yesterday so ymmv).  If anyone knows
different please correct me.

ZClasses have a unique_id that is generated when they are created.
Caveat:  older ZClasses didn't do this so you may need to add the id
manually (I have no idea how to do this).  Instances of this class get
this id when they are created.

If you distribute a ZClass definition and then upgrade it it will still
have the same id.  As a result, when you overwrite the new ZClass
definition over the older one, it also will have the same class
definition.  Restarting Zope will cause the new ZClass definition to be
loaded and the instances get the new behavior...  Pretty cool...

Okay Jim and Brian, let the roasting begin!  :^)

--Rob