[Zope-dev] Product upgrades

brian.r.brinegar.1 brinegar@purdue.edu
Tue, 22 Jan 2002 17:37:05 -0500 (EST)


I have done work on a couple of products and one thing I've noticed is if
you change what is done in the __init__ method of an object there isn't a
good way to make the change so that it takes effect on old instances of
the object. For example:

def init(self):
	self.data.append('cow')

becomes:

def init(self):
	self.data.append('cow')
	self.data.append('horse')

things created with the first constructor must be removed and recreated if
'horse' is to be added. Is there a way to go through and update old
instances of a product to a newer version? Or should backwards
compatibility be designed into the product?

Thanks,
--Brian