File Contents
Saving one object to a file is easy — just serialize it and away you go. Saving a web of objects requires storing the relationships, so that the web can be recreated from the file. There are several schemes that can be used to do this:
-
Use a serialization service that allows you to save a web of objects.
-
Otherwise, save each object as a continuous set of bytes in the file. This file (or an associated file) must contain enough information to map from object references (created from pointers as part of the process of serializing an object) to file offsets. These offsets are used to recreate the web by creating the focus object and then following object references.
-
Additional information may be needed for each object, such as the class name, the class's version number or the object ID.
© 1998 by Wrox Press. All rights reserved.