This page describe how the implementation of the object serialization written in Eiffel (a.k.a. SED) is done. SED is the natural evolution from the initial object serialization written in C 20 years ago. Unlike its C counterpart, SED is space efficient (usually smaller) and highly extensible.
To use SED, you need a reader/writer, i.e. a descendant of the class SED_READER_WRITER. This type will handle the low level storage of data, taking care of platform specifics details such as big endian vs little endian, size of pointers, where to store the data (memory, file, socket or who knows what kind of mediums).
Once you have a reader/writer, you have to choose your serialization method:
- session: the same running version of the executable can store and retrieve objects. A different run won't be able to retrieve the objects.
- basic: the same executable (i.e. it is platform specific) can store and retrieve objects even if it is not the same session.
- independent: different versions of the executable running on different platforms can store and retrieve objects.
- recoverable: same as independent with the possibility of fixing mismatches (see below).
Most users will choose the latest not only because its size overhead and speed overhead is quite low, but also because it offers the ability to fix mismatches. A mismatch is a difference between the types as they were stored and the types as they exist in the current version of the executable. Read mode about mismatches at SED and mismatches.
To make it easy to use SED, we have created a facility class SED_STORABLE_FACILITIES which will let you store/retrieve objects using your method of choice.