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.           

 OR,
  • 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.


Object Persistence in Databases
A persistent database stores persistent data in the form of objects, or records that are durable when changing devices and software. Persistent data is stable and recoverable. Traditional relational database management systems (RDBMS) store persistent data in the form of records and tables. However, they cannot store objects and their relationships. Objects have necessary features (like encapsulation, inheritance, persistence, and polymorphism) that do not translate well into records and tables. Thus, certain special databases like object-oriented database management systems (OODBMS) and object-relational database management systems (ORDBMS) are needed for storing objects and preserving object persistence.



Comments

Popular posts from this blog

What are different steps used in JDBC? Write down a small program showing all steps.

Discuss classification or taxonomy of virtualization at different levels.

Pure Versus Partial EC