|User's Guide: A Framework for Object Persistency for GNAT; Version 0.6.1; Document Revision $Revision: 1.17 $|
This section gives an brief overview about the ODB package from the programers point of view
An object is an instance of a class. A class is assumed to be implemented as an Ada 95 package which exports a data type and operations on this data type.
Persistent objects are always derived from the type ODB.Persistent.Object. All persistent objects are allocated in dedicated storage pool. Each object in the storage pool is linked to a so called object table which is contained in the ODB.Persistent package.
Since the type Persistent.Object is abstract, the implementation for the following methods has to be provided by any implementation of persistent object:
The function Factory return a pointer to an instance of the class.
Serialize writes out the object attributes into a memory stream and at the same time it has to setup the header information of an instance. The header contains a list of all attributes stored in the object and the corresponding offsets.