[squeak-dev] [proposal] migrating preferences to new images: UndefinedClass

Marcel Taeumel marcel.taeumel at hpi.de
Mon Apr 4 09:20:05 UTC 2022


Hi Lauren --

Our current mechanism of storing and loading preferences in files uses ReferencesStream, which reads and writes binary data.

If you could share more details on this issue, we might be able to re-configure the loading code for those (missing) classes. Otherwise, a generic "[ ... ] on: Error do: [:ex | ...]" might also help for a more robust "stream next" in Preferences class >> #loadPreferencesFrom:.

For more info on data streams, see implementors of:

#classVersion

#readDataFrom:size:
#objectForDataStream:
#withClassVersion:

Best,
Marcel
Am 29.03.2022 17:42:09 schrieb Lauren P <drurowin at gmail.com>:
Hi List,

When loading my.prefs into a new base image, if the class being configured doesn't exist loading stops quite unglamorously.

How about using a dummy superclass UndefinedClass that serves as the superclass of a class that hasn't been loaded? When the class isn't found, create it as a subclass of that. If the class is later loaded, class reshaping will change it into the appropriate class.

For the purpose of storing the preference value in the meantime, we could use method rewriting like editing help topics, or putting it directly in Preference as a dictionary entry.

By using a dummy superclass, you can browse for preferences set on unistalled software, as well as exclude them from release building.

How does this sound?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220404/44f9b45b/attachment.html>


More information about the Squeak-dev mailing list