What is OID? How persistent objects are maintained in OO Database?
OBJECT IDENTITY (OID)
One goal of an OIDis to maintain a direct correspondence between real-world and database objects so that objects do not lose their integrity and identity and can easily be identified and operated upon. Hence, a unique identifier is assigned to each independent object stored in the database. This unique identity is typically implemented via a unique, system-generated object identifier (OID). The value of an OID may not be visible to the external user but is used internally by the system to identify each object uniquely and to create and manage inter-object references. The OID can be assigned to program variables of the appropriate type when needed.
The main property required of an OID is that it be immutable; that is, the OID value of a particular object should not change. This preserves the identity of the real-world object being represented. Hence, an ODMS must have some mechanism for generating OIDs and preserving the immutability property. It is also desirable that each OID be used only once; i.e. even if an object is removed from the database, its OID should not be assigned to another object. These two properties imply that the OID should not depend on any attribute values of the object, since the value of an attribute may be changed or corrected.
OID is used for two purposes.
- To identity, each object is unique.
- Make reference to another object.
Properties of OID
- It is unique
- It is system generated
- It is invisible to the user
- It is not possible to perform operations on OID
- It is mutable i.e. once its generated
- It cannot be regenerated
- It has long integer values
Persistent objects are maintained in the OO database because:-
- Object-oriented databases store persistent objects permanently in secondary storage. Applications and programs share these persistent data and objects. Object-oriented database management systems (OODBMS) use computer-generated, unique identifiers to identify each object in the database.
- Persistent objects are stored permanently in the secondary storage of object-oriented databases. These persistent data and objects are shared across various applications and programs. An object-oriented database management system (OODBMS) offers computer-generated, unique object identifiers to access each object.
Comments
Post a Comment