Next: Persistent C++ Systems
Up: Persistent Programming Languages
Previous: Object Identity and Pointers
How are objects stored in a database?
Code (that implements methods) should be stored in the database as part of
the schema, along with type definitions, but many implementations store them
outside of the database, to avoid having to integrate system software such
as compilers with the database system.
Data: stored individually for each object.
How to find the objects?
Most OODB systems support all three ways of accessing persistent objects.
All objects have object identifiers.
Names are typically given only to class extents and other collection
objects, and perhaps to other selected objects, but most objects are
not given names.
Class extents are usually maintained for all classed that can have
persistent objects, but in many implementations, they contain only
persistent objects of the class.
Give names to objects like we give names to files: works only for small
sets of objects.
Expose object identifiers or persistent pointers to the objects:
Store the collections of object and allow programs to iterate over
the collections to find required objects.
The collections can be modeled as objects of a collection type.
A special case of a collection is a class extent, which is a
collection of all objects belonging to the class.
Figure 8.7: Example of ODMG C++ Object Definition Language
Mon Jun 29 17:30:13 PDT 1998