Object-oriented databases: concept, basic concepts, management, examples

Table of contents:

Object-oriented databases: concept, basic concepts, management, examples
Object-oriented databases: concept, basic concepts, management, examples
Anonim

In object-oriented databases (OODBs), users can set operations on a particular database, which is made up of objects that can be of a wide variety of types and for which operations are set. They can process binary information efficiently, such as multimedia objects. Another added benefit of OODB is that it can be programmed with slight procedural differences without affecting the entire system.

Prerequisites for the creation of the standard

The history of object-oriented OODB databases begins at the end of the last century. They were created to meet the needs of new applications. The assumption was that object-oriented databases would revolutionize software systems during the 1990s. It is now clear that this is not the case. However, the revival of this concept through the free software communities and the identification of suitable applications for it motivates a review of the characteristicsOODB, which is an alternative to the ubiquitous relational databases.

Prerequisites for the creation of the standard

Object-oriented provides the flexibility to handle some or all of the requirements and is not limited to the data types and query languages ​​of traditional databases. A key feature of OODBs is the ability they provide to the developer, allowing him to specify both the structure of complex objects and the application operations. Another reason for creating OODBs is the growing use of languages ​​for software development.

Databases have become the foundation of many information systems, but traditional databases are hard to use when the applications that access them are written in C++, Smalltalk or Java. For example, 1C object-oriented databases were designed in such a way that they can be directly integrated with applications using object-oriented languages ​​by adopting their concepts: Visual Studio.Net, C ++, C, Microsoft SQL Server and others.

The main advantage of OODB is the complete elimination of the need for RMs1 (impedance) with subsequent performance improvements.

The main advantage of OODB

Flaws:

  1. Very primitive consultation mechanisms, no self-standard accepted platform.
  2. Can't store procedures because objects can only be accessed in the client.
  3. Immaturity in the market.
  4. No physical grouping of objects.

Object paradigm

Object paradigm

Object-oriented databases are programmable databases that store complex data and its relationships directly without assigning rows and columns, making them more suitable for applications that work with large batches. Objects have many-to-many relationships and are accessible through the use of pointers that are associated with them to establish relationships. Like any programmable, OODB provides an application development environment and a persistent repository ready for exploitation. It stores and manipulates information that can be digitized in the form of objects, provides quick access and provides great processing capabilities.

Basic concepts used in an object-oriented database:

  • object identity;
  • constructor type;
  • language compatibility;
  • type hierarchies and inheritance;
  • processing complex objects;
  • polymorphism and operator overloading;
  • creating versions.
Versioning

In order to fully consider all the aspects that characterize an object-oriented database, it is important to note all the important object paradigms:

  1. Encapsulation is a property that allows you to hide information for other objects, thereby preventing incorrect access or conflicts.
  2. Inheritance is a property by which objects inherit behavior in a class hierarchy.
  3. Polymorphism is a property of an operation with which it can be applied todifferent types of objects.
  4. The interface or signature of an operation includes the name and data types of its arguments or parameters.
  5. The implementation or method of an operation is specified separately and can be changed without affecting the interface. User applications can work with data by calling specified operations through their names and arguments, regardless of how they were implemented.

Classes and functionality

Classes and functionality

When considering the concept of classes in OODB, it is necessary to distinguish between the terms "class" and "type". A type is used to describe a set of objects with similar behavior. In this sense, it depends on what operations can be called on the object. A class is a collection of objects that share the same internal structure, so it defines an implementation, while a type describes how to use it.

The term instantiation refers to the fact that instantiation of a class can be used to produce a set of objects that have the same structure and behavior as set by the class.

A feature that is very important for the evolution of objects is that it can change its class, including attributes and operations, while maintaining identity. This would require a mechanism to handle the resulting semantic integrity.

Inheriting an organization's object-oriented database allows a class to be defined as a subclass of an already existing superclass. It will inherit all attributes and methods from the latter and may optionally defineown. This concept is an important mechanism to support reuse. The same parts of the structure of two different classes can only be defined once in a common superclass, thus less code will be written. There are some systems that allow a class to be a subclass of more than one superclass. This feature is called multiple inheritance as opposed to single inheritance.

Example of an object-oriented database

It is often useful to use the same name for different but similar methods of the media superclass from the picture and video classes. Many files can be viewed by different viewers. They often need to view all photos and videos using the "view" method, and the appropriate program must be launched. When the function is called and a link to the video is passed, the media player is launched. To implement this feature, first of all, it is necessary to define the "presentation" operation in the common media superclass from the picture and video classes. Each of the subclasses redefines the lookup operation for their specific needs. This results in different methods that have the same operation name. In this case, using this function has an important advantage.

OODB structure

OODB structure

The object-oriented paradigm is based on the encapsulation of data and code related to each object in a single module. Conceptually, all interactions between it and the rest of the system are carried out using messages. Hence the interfacebetween them is determined by the permitted set.

In general, each object is associated with a set:

  1. Variables that contain object data and correspond to ER model attributes.
  2. Messages he replies to. Each may or may not have parameters, one or more.
  3. Methods, each of which is a code that implements messages and returns a value in response to it.

Messaging in an OO environment does not imply the use of physical SMS in computer networks. On the contrary, it refers to the exchange of requests between objects, regardless of the correct details of their implementation. Sometimes an expression calls a method to trigger the fact that a message has been sent to an object, and uses the execution of the corresponding method.

Object identity

Object Identity

The object-oriented database system provides a unique identification for each independent object stored in the database. It is usually implemented using a system generated unique object identifier or OID. The OID value is invisible to the external user, but the system uses it internally to manage links between objects.

The main property of an OID is to be immutable. The OID value for a particular object should never change. This preserves the identity of the real world being represented. It is also preferred that each OID is used only once, even if it is removed from the database, its OID should not be assigned to another. It is also often considered inappropriate to base it on a physic althe address of the object in storage, since reorganizing them in the database can change the OID. However, some systems use the physical address as the OID to increase the efficiency of retrieving objects. An object-oriented framework automatically imposes relational constraints, usually more applicable: domain, key, object integrity, and referential integrity.

Three main constructors

Three main constructors

In OODB, values ​​or states of complex objects can be created from others using constructors of certain types. One way to represent them is to think of each as a triplet (i, c, v), where i is the object's unique identifier (OID), c is the constructor, that is, a pointer to how the value of the object is created, and v is the value or state of the object. There may be multiple constructors depending on the data model and the OO system.

Three basic object-oriented database constructors:

  • atoms;
  • tuples;
  • sets.

Other more common uses are lists and charts. There is also the D domain, which contains all the basic atomic values ​​directly available on the system. They typically include integers, real numbers, character strings, dates, and any other type of data that the system handles directly. Both the structure of objects and operations are included in class definitions.

Compatibility with programming languages

The core concepts of object-oriented databases are used inas design tools and codified to work with the database.

There are several possible languages ​​in which these concepts can be integrated:

  1. Expanding a language for data processing like SQL by adding complex types and OOP. Systems provide object-oriented extensions to relational systems, called object-oriented relational systems.
  2. Using an existing object-oriented programming language and extending it to work with databases. They are called persistent programming languages ​​and allow developers to work directly with data without having to go through a data processing language like SQL. They are called persistent because the data continues to exist after the end of the program that created it.

When deciding which option to use, keep in mind that persistent languages ​​tend to be powerful, and it's relatively easy to make programming mistakes that damage the database. The complexity of languages ​​makes high-level automatic optimizations, such as reducing disk I/O, difficult. In many applications, the ability to make declarative queries is important, but persistent languages ​​currently do not allow such queries without problems.

Hierarchy of inheritance types

Object-oriented database schemas typically require a large number of classes. However, several classes are similar to each other. To allow a direct representation of the similarities between them, you need to putthem into a hierarchy of specializations. This concept is similar to ER models. Class specializations are called subclasses, which define additional attributes and methods for an existing class. Objects created with subclasses inherit everything from the parent. Some of these inherited characteristics may have themselves been borrowed from those higher up in the hierarchy.

Objects are considered complex because they require a significant amount of storage space and are not part of the standard data types that Object Oriented Database Management (OODBS) usually offers. Since the size of objects is significant, SOOBMS may receive a portion of an object and provide it to an application before retrieving the entire object. It can also use buffer and cache methods to get parts of an object ahead of time, before the application has access to them.

OODB allows users to create new types that include both structure and operations, in this case the extensible type system. You can create libraries of new types by defining their structure and operations. Many of them can store and receive a large structured object in the form of strings and characters or bits that are passed "as is" to the application program for interpretation.

The method can directly access the target object's attributes by name, including any inherited from parent classes, but must access attributes of other objects with secondary signals. The concept allows you to associate the same operator name or symbol withtwo or more different implementations of it, depending on the type of objects it applies to.

Building Apps

Application Creation

Many database applications using OO systems require multiple versions of the same object. Typically, maintenance activities are applied to a software system as their requirements change, and involves changing some of the development and implementation modules. If the system is already running and if one or more modules needs to be changed, the developer must create a new version of each of them by making changes.

Note that there can be more than two versions of an object, in case two are required in addition to the original module. Own versions of the same software module can be updated at the same time. This is called parallel object-oriented database design. However, there always comes a point where they need to be merged in order for the hybrid OODB to incorporate the changes that have been made so that they are compatible.

Object-oriented conditions

All computer systems must have properties of their architecture to be considered. For example, a system must have tables to be considered relational. OODB is no exception and contains some basic properties of the object architecture. However, in the real world, many of these properties are discussed and some, such as multiple inheritance, are considered enhancements to the object-oriented database model rather thanas part of the baseline. For example, in the object-oriented language Smalltalk, multiple inheritance is not supported, even though it is considered part of the object architecture.

Methods for a class define a set of operations that can be performed on an object. For example, when it is applied to an object, it either returns a value or performs some operation to update the values. Sometimes methods don't return it. If the method were designed to update the number of passengers for a vehicle, no value would be returned, but the data element in the target would change it.

Objects are a fundamental concept in OODB. Essentially, objects are an abstract representation of the real world things that are stored in it. An object is an instance of a class in the sense that it is excluded from its definition.

You can think of an object as a self-contained package that has three parts:

  1. Own personal information, data values.
  2. Private procedures that will manipulate values ​​through the class definition.
  3. Open interface so this object can communicate with others.

OODB examples

Using OODB simplifies the conceptualization because it is more natural to represent the information that needs to be stored. To model the structure or logic of a database, the use of class diagrams allows you to introduce classes with their structural relationships and inheritance. In order to model part of the dynamics, interaction andbehavior between objects, a sequence diagram will be used to represent the interaction between objects located in a temporary relationship, describing the possible states so that they can be found given the changed state after the event occurs.

OODB examples

An example of an object-oriented database is shown below.

Examples of object-oriented databases

They have a name and a lifetime, which can be temporary or permanent. The OODB key is the ability they provide to the developer to specify how many structures and operations will be applied to them. There is flexibility and support for handling complex data types. You can create classes and subclasses, for example, the client base can have a subclass of this client's link, and it will inherit all the attributes and characteristics of the original class, this approach allows you to quickly and flexibly process complex data.

Popular topic