[squeak-dev] About best ways preserving backward compatibility

Igor Stasenko siguctua at gmail.com
Tue May 5 23:11:45 UTC 2009


Hello again,

I implemented a new delays, called AdvancedDelay (such a bold name
:)), and now during installation of new Processor need to switch Delay
-> AdvancedDelay.

Now, the problem is, that we having a Delay's sitting in image, and to
make transition w/o problems i need to make all Delays migrate to a
new instances.
Also, i'd like to being able to switch back to old class, in case if
image running under older VM, which does not supports new primitives.
There are a couple of alternatives,
rename a Delay class, to something like OldDelay, and use a Delay
global var as a placeholder for currently installed class, so it can
switch between OldDelay and AdvancedDelay at image startup.
But newest Delays having a subclasses (DelayWaitTimeout, MonitorDelay)
which makes this a bit more problematic.

Another option which i thought, is to make a Delay class abstract, and
have a subclasses with concrete implementations, while
Delay class>>someMessage implement as:
  ActiveDelayClass someMessage  "ActiveDelayClass is class var"

Third option would be forget about backward compatibility and
overwrite Delay with new Delay class.

So, i want to ask people: what you think , what way is preferable?
Do i need to care about backward compatibility (in order to be able to
run newer images on older VMs), or not? And if do, then what the best
way?
VM changes is backward compatible (you can run old images with new VM
w/o problems).

-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list