In order to get confidence in the way Smalltalk works, you should try the following
right now !
Lets assume, that you messed up the system. This can be done by changing one of
the elementary system classes (for example, by adding buggy code)
or by removing some heavily required component (for example, by nilling a global),
or when you "enhance" a heavily used component such as the scrollbar or the text editor.
Lets also assume, that you forgot to save a snapshot image recently.
This means, that you either have no snapshot at all, or the existing snapshot is old
(typically, a few hours).
To recover from such a situation, you have to start ST/X (with the newest
snapshot available) and then reapply individual changes
(up to, but excluding any of the "bad ones") via the ChangesBrowser.
To try this in the real world, perform the following steps:
- Save a snapshot (Launcher's save button)
- Add some good stuff (create a class, add a few methods) in a browser
- Add a crashing bug to ST/X;
for example, redefine the new:
-method
of the Array
class as follows:
new:anInteger
^ 'not an array at all'
this means: redefine the instance creation of the Array
class to return a constant
string instead. This will definitely crash ST/X within the next few milliseconds,
as the Array class is one of the most central classes in the system.
- After the crash, restart ST/X (it will come up using the last snapshot, or fresh, if there is none).
If the snapshot already includes the bad change, and has problems to start,
then enforce ST/X to start fresh without a snapshot image ("
stx -I
").
- open a ChangesBrowser via the launcher.
- You should see the above changes at the end of the list.
Reapply them individually - but exclude the last, bad change.
- optionally save the current state (the good state) as a new snapshot
- continue to work
We did the above, to give you a good and warm feeling of safety,
your work is not lost, even if ST/X crashes within a coding session.
However, how often does such a situation arise in the real world ?
The answer is: very very seldom. Over the years, the system has become quite
mature, even with respect to severe errors. Systems typically run for weeks or
months with heavy coding going on. If you keep away from system classes (such as
Array or all of the GUI classes which the system itself uses), you can easily
live for a very long time in an image.
Continue in "Deploying an Application".
Copyright © 1996 Claus Gittinger Development & Consulting
Copyright © eXept Software AG
<cg at exept.de>
Doc $Revision: 1.9 $ $Date: 2021/03/13 18:24:49 $