For example, an object representing a time, with attributes for year, month, timezone, etc., could be serialised as the string "01 Jul 2002T14:33:52-0800", or an XML element "<dateobj year='2002' month='02' day='24' hour='14' minute='33' second='52' timezone='-0800' />", or as a binary string.
As well as providing an external data representation (e.g. representing an integer as a string of ASCII digits) and marshalling components into a single block of data, a serialisation algorithm needs to follow pointers to include objects referred to by the initial object. This is further complicated by the possible presence of cycles in the object graph.
It should be possible to store the serialised representation on disk, or transmit it across a network, and then restore it as an object (graph) that is the same as the original.
(01 Jun 2001)
|Bookmark with:||word visualiser||Go and visit our forums|