Questions about a cross-platform object store

Lex Spoon lex at cc.gatech.edu
Mon Dec 11 06:39:09 UTC 2000


The actual format for DataStream and SmartRefStream haven't changed, as
far as I know.  However, the layout of the classes within them certainly
can change.  The problem that upgrades cause is that classes can have
more or fewer instance variables than your on-disk objects have.

I can't think of an effortless solution.  I think you'll simply have to
pay attention whenever classes change whose instance might be stored on
disk.  It will be important to try and minimize such changes, and it
will be important to choose classes that are unlikely to change.

Now, SmartRefStream does have a mechanism for dealing with class
changes.  When you load an object of class A version X into an image
where class A is at version Y, SmartRefStream will ask you to write a
conversion method.  This method will be automatically use whenever an A
instance needs upgrading from version X to Y.  The nice thing is, these
methods can be filed out and filed into other images, so that you don't
have to keep rewriting them.


Anyway, it's certainly not an easy problem to deal with. 


-Lex




Jon K Anderson <jonkanderson at yahoo.com> wrote:
> Hello,
> 
> I was looking for the best way to store objects into a file and I am
> attracted to using the ReferenceStream for this purpose.  I want to be
> able to save the objects into a file on a Linux system and read the file
> on a Windows NT system.  A little test with the DataStream>>example
> method seemed to work just great.  But, I am a concerned about losing my
> data in these files unless upgrades are vigilantly maintained.
> 
> My questions: When it is necessary to upgrade to a new version Squeak,
> how do I migrate all of the objects in my file(s) so that they can be
> read by the new version?  Is it possible to skip a version or two of
> Squeak and still be able to migrate those objects?  Is there another
> object format in Squeak I should think about using which is
> semi-guaranteed not to change?
> 
> Thank you for your help,
> Jon





More information about the Squeak-dev mailing list