NAME Osm.pm -- persistent object storage manager. DESCRIPTION Persistent objects are Perl objects that are tied to the database via the persistent storage manager. Each object has an identifier which is unique within the database file. Object identifiers are system generated. External identifiers which are unique within the datafile can be assigned to objects when they are created. *Osm.pm* implements object cache that store recently used objects. Cache is realized using LRU (least recently used) strategy to choose the objects to be removed from cache. The size of object cache can be set as the system parameter via the configuration record of a datafile in run-time. Objects can be accessed either directly using object identifiers, or thru scan operator (iterator). When accessed using object identifiers, objects are manipulated thru the in-memory pointers to Perl objects in cache. Routines for the manipulation of objects mark the object ``changed'' when components are altered, so they don't need to be treated thereafter. However, the user is responsible that object is accessed each time before it is used. OBJECT REPRESENTATION Every object has an identifier denoted as object identifier or oid. Objects can have functional or multi-valued attributes. The term ``attribute'' corresponds to what is also called object component, data member, data field, etc. The range of the functional attribute can be an atomic value: number, string or object (oid). Multi-valued attribute is an array of atomic values. The data model of Qios is formally presented in the report entitled "Unifying schema and instance levels of object-oriented databases" (see DOCUMENTS). From a programmer's perspective, an object is a reference to the associative array (blessed;) and an attribute is a hash entry which can be either a Perl scalar (typed) or a reference to an array of scalars. Storage manager differentiates between two kinds of objects: class objects and individual objects (instances). Each class object is associated to the set of its sub-classes and its instances. The storage manager implementation is based on the hierarchical and network data models: class, its instances and sub-classes are linked in a ring realized in *Osm.pm* by a double linked list. Types Types are viewed as data structures. Qios distinguishes between two sorts of types: atomic type and tuple-structured type. Atomic types are: *number*, *string* and *object*. The type *object* is a generic term that stands for object identifiers referring to user-defined types (actually *object* is oid of the root class object; see presentation of the Qios data model in [] for details). Tuple-structured types have components or attributes which are either functional or multi-valued (implemented as refs to arrays). The range of functional and multi-valued attributes can only be atomic types. As suggested by the above description, types (ie. data structures) together with the corresponding object identifiers form *class objects*. The structure of the Qios database can then be viewed uniformly as partially ordered set of objects: class objects and instances (individual objects) interrelated by the inheritance (isa) relationship. OBJECT MANIPULATION The basic functions on objects are used to create, delete, and manipulate objects. The functions are: *obj_new*, *obj_create*, *obj_fetch*, *obj_delete*, *obj_dispose*, *obj_set*, and *obj_get*. Object state can be read and altered using the procedures for the manipulation of object attributes. The procedures for reading and altering functional attributes are: *attr_set* and *attr_get*. The procedures for manipulation of multi-valued attributes are work same as Perl procedures for list manipulation; they are: *attr_setmv*, *attr_getmv*, *attr_push*, *attr_unshift*, *attr_pop*, *attr_shift* and *attr_del*. The procedures used for the manipulation of object values which are used during query processing are: *obj_copy*, *obj_project*, *obj_diff*, *obj_dupl* and *obj_join*. The first three operations preserve the identity of objects while the last two generate new objects. The iterative access to the instances and sub-classes of class object is provided by procedures: *scan*, *next* and *close*. The names of the attributes of a given object can be accessed using procedures: *scan_attr*, *next_attr* and *close_attr*. COMMENTS This module is part of the *qios* programming environment.