Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Serialization
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Smalltalk=== In general, non-recursive and non-sharing objects can be stored and retrieved in a human readable form using the <code>storeOn:</code>/<code>readFrom:</code> protocol. The <code>storeOn:</code> method generates the text of a Smalltalk expression which β when evaluated using <code>readFrom:</code> β recreates the original object. This scheme is special, in that it uses a procedural description of the object, not the data itself. It is therefore very flexible, allowing for classes to define more compact representations. However, in its original form, it does not handle cyclic data structures or preserve the identity of shared references (i.e. two references a single object will be restored as references to two equal, but not identical copies). For this, various portable and non-portable alternatives exist. Some of them are specific to a particular Smalltalk implementation or class library. There are several ways in [[Squeak|Squeak Smalltalk]] to serialize and store objects. The easiest and most used are <code>storeOn:/readFrom:</code> and binary storage formats based on <code>SmartRefStream</code> serializers. In addition, bundled objects can be stored and retrieved using <code>ImageSegments</code>. Both provide a so-called "binary-object storage framework", which support serialization into and retrieval from a compact binary form. Both handle cyclic, recursive and shared structures, storage/retrieval of class and [[metaclass]] info and include mechanisms for "on the fly" object migration (i.e. to convert instances which were written by an older version of a class with a different object layout). The APIs are similar (storeBinary/readBinary), but the encoding details are different, making these two formats incompatible. However, the Smalltalk/X code is open source and free and can be loaded into other Smalltalks to allow for cross-dialect object interchange. Object serialization is not part of the ANSI Smalltalk specification. As a result, the code to serialize an object varies by Smalltalk implementation. The resulting binary data also varies. For instance, a serialized object created in Squeak Smalltalk cannot be restored in [[Ambrai Smalltalk]]. Consequently, various applications that do work on multiple Smalltalk implementations that rely on object serialization cannot share data between these different implementations. These applications include the MinneStore object database<ref>{{Cite web|url=http://minnestore.sourceforge.net/|archive-url=https://web.archive.org/web/20080511234145/http://minnestore.sourceforge.net/|archive-date=11 May 2008|website=SourceForge|title=MinneStore version 2}}</ref> and some [[Remote procedure call|RPC]] packages. A solution to this problem is SIXX,<ref>{{Cite web|url=http://www.mars.dti.ne.jp/~umejava/smalltalk/sixx/index.html|title=What's new|access-date=25 July 2021|website=SIXX - Smalltalk Instance eXchange in XML|date=23 January 2010}}</ref> which is a package for multiple Smalltalks that uses an [[XML]]-based format for serialization.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Serialization
(section)
Add topic