What is a relational data model for entities

The relational database model

The object-oriented database model provides for the storage of data as objects. Objects are modulated in the same way as object-oriented programming. An object defines an entity and contains:

  • the properties (attributes) required to describe the entity,
  • References (relationships) to other objects as well
  • Functions that enable access to the stored data (methods).

An object is therefore a group of data in which the interface is also defined through which this data is accessed. Objects are one of the abstract data types.

Each object is automatically assigned an ID by the object-oriented database management system (ODBMS). This enables the object to be clearly identified and addressed using methods. These Object ID is state-independent, i.e. decoupled from the object values. It is thus possible to give two objects with the same data (i.e. with the same status) two different IDs. This clearly distinguishes the object-oriented database model from the relational model, in which each tuple can be identified using its data (e.g. by a primary key).

Another feature of the object-oriented database model is the Data encapsulation. Stored data can only be accessed using the previously defined methods. The data encapsulated in the object are thus protected against changes via undefined interfaces.

In the object-oriented database model, database structures are created using a hierarchical class system Are defined. In object-oriented programming, a class is understood to be a set of objects that have the same characteristics. Every object class is based on a class definition. This schema specifies the attributes and methods of all objects in the class and thus determines how these are created and changed.

Users interact with the ODBMS with an SQL-based query language for object databases: the Object Query Language (OQL). The result of an OQL query is not a result set, as is the case with SQL, but a list of those objects that meet the conditions of the OQL statement.

Well-known implementations of the object-oriented database model are Realm, ZODB and Perst.

Object-oriented databases were developed as a solution to a problem in application development that is known as Object-relational impedence mismatch(object-relational incompatibility).

If objects from an object-oriented programming language (e.g. C #, C ++ or Java) are to be stored in a relational database, incompatibilities inevitably arise due to fundamental differences between the two programming paradigms.

  • Relational databases do not support object-oriented concepts such as classes and inheritance.
  • The state-independent object identification cannot be implemented in the relational database model.
  • The protection mechanism of data encapsulation is not available in the relational database model.

One approach to avoid the incompatibility problems mentioned is to do without relational databases and instead use an object database in the context of object-oriented application programming. However, this inevitably goes hand in hand with the disadvantage that data encapsulated in objects are not available independently of the associated application. Then there is the low distribution of object databases. Most tools and interfaces for analyzing data stocks are still designed for relational databases and do not support the object-oriented data model.

However, application developers who do not want to forego the advantages of relational data storage have the option of compensating for incompatibilities with the help of object-relational mappers (O / R mappers). Functionalities for object-relational mapping (object-relational mapping, ORM) are implemented via libraries. These create an abstraction layer between the object-oriented application and the data stored in tables.

Numerous manufacturers of relational database systems also equip their products with functions that compensate for incompatibilities with object-oriented programming. Database systems of this type are called "object-relational".

Object-oriented databases transfer the basic principles of object orientation to database technologies and are therefore particularly suitable for object-oriented application programming. Corresponding database systems, however, are rare and in some cases are not yet ready for the market.