Serializing objects?

Bijan Parsia bparsia at email.unc.edu
Sun Jun 11 05:09:08 UTC 2000


On Sat, 10 Jun 2000, Aaron J Reichow wrote:

> I've been working with VAST and GemStone a bit at work, and am beginning
> to want something similar to it to play with at home, in Squeak.
> 
> I've heard one can serialize an object in Squeak, making it into a chunk
> of binary data for export into a file, or over the network.  How does one
> do this?  How can this serialized object be read, and thrown into the
> running image?

Check out DataStream and friends. For practical applications, see the
"Persistence" page on the swiki:
	http://minnow.cc.gatech.edu/squeak/512

MinneStore is a fully fledged Smalltalk based object db which I've never
managed to get working for me :) But it uses the serialization streams
(I believe) to save objects out to files.

FileDictionary is very easy to follow and let's you have persistent
dictionaries, which is quite handy. I'd look here if you want examples of
how to serialize.

> A serialized object could be stored into a BLOB on a MySQL database, and
> retrieved from there.  This kind of thing would be passive, and not active
> like GemStone, but it would be a start, and perhaps a way to distribute
> data or classes to other machines on a network.  I looked at MinneStore,
> but it seems like it's confined to reading and saving from a OODB on the
> disk, and not via the network.

Well, I don't think it'd bet that hard to adapt it, but, hey, I can't even
get it working, so what do *I* know.

Also, there are two Camp Smalltalk projects that're worth exploring:

	http://wiki.cs.uiuc.edu/CampSmalltalk/Object%2FRelational+Mapping

This is GLORP, and it's after a object-relational mapping system.

And:

  http://wiki.cs.uiuc.edu/CampSmalltalk/Portable+Program+Representation

which aims to bring cross-dialect binary serializtion (or something) ;)

Cheers,
Bijan.





More information about the Squeak-dev mailing list