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

Suppose that a data warehouse for Big-University consists of the following four dimensions: student, course, semester, and instructor, and two measures count and avg_grade. When at the lowest conceptual level (e.g., for a given student, course, semester, and instructor combination), the avg_grade measure stores the actual course grade of the student. At higher conceptual levels, avg_grade stores the average grade for the given combination. a) Draw a snowflake schema diagram for the data warehouse. b) Starting with the base cuboid [student, course, semester, instructor], what specific OLAP operations (e.g., roll-up from semester to year) should one perform in order to list the average grade of CS courses for each BigUniversity student. c) If each dimension has five levels (including all), such as “student < major < status < university < all”, how many cuboids will this cube contain (including the base and apex cuboids)?

Suppose that a data warehouse consists of the four dimensions; date, spectator, location, and game, and the two measures, count and charge, where charge is the fee that a spectator pays when watching a game on a given date. Spectators may be students, adults, or seniors, with each category having its own charge rate. a) Draw a star schema diagram for the data b) Starting with the base cuboid [date; spectator; location; game], what specific OLAP operations should perform in order to list the total charge paid by student spectators at GM Place in 2004?

Suppose that a data warehouse consists of the three dimensions time, doctor, and patient, and the two measures count and charge, where a charge is the fee that a doctor charges a patient for a visit. a) Draw a schema diagram for the above data warehouse using one of the schemas. [star, snowflake, fact constellation] b) Starting with the base cuboid [day, doctor, patient], what specific OLAP operations should be performed in order to list the total fee collected by each doctor in 2004? c) To obtain the same list, write an SQL query assuming the data are stored in a relational database with the schema fee (day, month, year, doctor, hospital, patient, count, charge)