[Zope3-dev] Re: [Zope] Zope (X)3 FAQ

Steve Alexander steve@cat-box.net
Tue, 22 Apr 2003 15:33:51 +0200


>> You look at its state, then decide based on the state.
>> Or, you make the upgrade process idempotent.
> 
> What happens when the different if-then-else things build up over time?

You get a mess.
Upgrade scripts are generally better.

ZODB 4 should have support in it for upgrading all instances of a 
particular class, and reloading that class, in a single transaction. Or 
something like that.


>>> What are the performance implications of using __setstate__ in this way?
>>
>> It usually works pretty well.
> 
> I'm not questioning how well it works, I'm wondering what the 
> performance implications are...

That's what "performance implications" means. Whether it works successfully.

See dictionary.com if you don't believe me:

   http://dictionary.reference.com/search?q=performance


> PS: FWIW, I've always prefered run-once upgrade scripts to fix things 
> like this (see Squishdot's updaters). You don't end up with complex 
> __setstate__ methods and you can correct the results of previous bugs in 
> the process...

Right. I agree.

--
Steve Alexander