[BUG] loading new version of RB deletes important methods

Avi Bryant avi at beta4.com
Thu Sep 18 22:36:10 UTC 2003


On Thu, 18 Sep 2003, Ned Konz wrote:

> Would it work to have an otherwise empty class with an initialize
> method that just does some work and deletes itself?

I dunno about the "deletes itself" bit...
In fact, I'm pretty sure you don't want that, because then the next time
you load a version, that class will get re-added and its #initialize
method re-called.

What you want is a series of UpdateToVersion23,
UpdateToVersion24, UpdateToVersion25 classes, each with an initialize
method that performs the appropiate tweaks.  Only the ones that are being
added will have #initialize sent, you you should get the right sequence of
updates no matter what you started with.

You need to ensure that they get loaded in the right order - one way might
be to make them form a linear class hierachy, and the dependency mechanism
should take care of it for you.

You also ideally want some flag that stops any of them from running in the
case that it's a first-time load.

Ideally there would just be a first-class notion of "update script" in
Monticello, though.  Any ideas as to how this should work?



More information about the Squeak-dev mailing list