Object-Oriented DataBase Management System
What Is an Object-Oriented Database?
Object-oriented databases emerged to meet the need of coupling object-oriented programming
languages with a database. Although object-oriented databases have been around since the late 1970s,
they have seen relatively low adoption in recent decades with the growing prevalence of functional
programming languages and relational databases. But a growing user community is awakening to the
ability of object-oriented databases to deliver fast queries with lighter code.
An object-oriented database (OOD) is a database system that can work with complex data objects that
is, objects that mirror those used in object-oriented programming languages. OR better still it is a
database system that deals with the modelling and creation of data as objects.
Basic Terminologies
Objects are a real world entities, such as a specific task in a to-do list: “take the garbage out”. All objects
are assigned a class within data structures for both hierarchy and functional purposes. So, when you
hear the phrase "instances of a class," this is simply a reference to objects created from particular
classes.
Attributes and Methods: An object has state and behaviors. Objects also have properties (attributes)
like name, status, and createdate. The set of properties, taken together, represents its state. Objects
also have behaviors (known as methods, actions, or functions) that modify or operate on its properties.
Examples include updatetask() or gettaskhistory(). Methods are also the primary path of object-to-
object communication.
Classes: are a grouping of all objects with the same properties and behaviors. In our example above, we
talked about task objects. These objects together all belong to the Task class.
class task
String name;
String status;
Date create_date;
public void update_task(String status)
{
}
}
Not only do classes indicate relationships, such as parent and child, but they also classify objects in
terms of function, data types, or other defined data attributes.
Pointers: are addresses that facilitate both object access and establishing relationships between objects.
Object-oriented programming (OOP) Principles
With an understanding of key OOD elements such as classes and objects, as well as methods and
method usage, it's possible to dive deeper into object-oriented programming (OOP) concepts and the
associated programming paradigm.
Abstraction: Abstraction is a way of capturing the necessary information to perform desired
functionality while excluding unneeded information. Not only does abstraction reduce complexity, but it
also enables developers to easily select and reuse important functional information quickly which
benefits both timelines and budgets.
Encapsulation: Encapsulation refers to the ability of each object to maintain a private state within its
assigned class. This means that no other object can directly access that object's state and no other class
can alter its functions. The benefit of encapsulation is that it protects the object from unwanted
interference and human error.
Inheritance: Inheritance enables objects to acquire some of the attributes or properties of another
object by reusing the existing fields and methods. In other words, by accessing the desired information
isolated through abstraction, but without altering the private states of the objects within a class due to
encapsulation, desired fields, attributes, and methods of a specific class can be applied to a specific
object. For example, assume we have a parent class called "car," a child class called "Chevrolet," and an
object called "Camaro." Using inheritance, we can easily create object "Impala," by taking the fields and
methods from object "Camaro" and then further customizing "Impala" through additional attributes or
methods. Inheritance represents significant time savings while helping to reduce errors in object
creation.
Polymorphism: Polymorphism enables a child class to use class attributes like its parent class, while
retaining all of its unique methods and attributes. To use a real world example, assume that we have a
parent class of "vehicle" with a child class "car" and want to determine tax deduction qualifications. User
defined data may identify which vehicles qualify for tax deductions, but those are simply attributes
within the data structure of a class. Class instances (objects) are created by developers with specific
methods through object-oriented programming (OOP) languages to share class attributes of "vehicle"
with "car" to signify tax deductibility without compromising the methods and attributes of the objects
found in "car."
In object-oriented programming (OOP), everything is an object. In addition, many objects are quite
complex, having different properties and methods. Object-oriented database management systems
work in concert with OOP to facilitate the storage and retrieval of object-oriented data.
What is an example of an object-oriented database?
MongoDB does offer an OOD called Realm where the query language constructs native objects through
the SDK you use. For example, in the JavaScript SDK, an object fetch look something like:
const myTask = realm.objectForPrimaryKey("Task", 12345);
Where are object-oriented databases used?
OODs are most often used with object-oriented programming languages like Java, Kotlin, C#, Node JS
(React), and Swift. Industries that use OODs are typically those built on an object-oriented language and
to boost productivity while working with complex data structures.
Advantages of object-oriented databases?
With all of their complex associations to other objects, and because complex data objects persist in an
OOD, the most significant advantage of the OOD over RDBMS is the ability to query across these
complex relationships very quickly.
There are no slow “joins” as in an RDBMS. Instead, you have fast queries with complex data.
Disadvantages of object-oriented databases?
An OOD may be a great choice if you're using an object-oriented programming language and need to
manage complex data with complex object-to-object associations. Designing and optimizing a database
system for these kinds of complexities, however, also has its trade-offs.
Additionally, while users of RDBMS can enjoy a standard query language (SQL), users of object-oriented
database systems may not have widely adopted standards at their disposal. For the most part, each
flavor of OOD is coupled tightly to an object-oriented programming language, and querying syntax is
very language-dependent.
Lastly, the OOD user community still feels small in comparison to the exploding ecosystem of web
development within the RDBMS space (In other words OOD databases are different and more
challenging to learn for non-programmers). But the community is fast-growing and likely to make up for
lost time.
Definition and Overview of ODBMS
The ODBMS which is an abbreviation for object-oriented database management system is the data
model in which data is stored in form of objects, which are instances of classes. These classes and
objects together make an object-oriented data model. Or ODBMS stands for Object-Oriented Database
Management System, which is a type of database management system that is designed to store and
manage object-oriented data. Object-oriented data is data that is represented using objects, which
encapsulate data and behavior into a single entity.
An ODBMS stores and manages data as objects, and provides mechanisms for querying, manipulating,
and retrieving the data. In an ODBMS, the data is typically stored in the form of classes and objects,
which can be related to each other using inheritance and association relationships.
In an ODBMS, the data is managed using an object-oriented programming language or a specialized
query language designed for object-oriented databases. Some of the popular object-oriented database
languages include Smalltalk, Java, and C++. Some ODBMS also support standard SQL for querying the
data.
Components of Object-Oriented Data Model:
The OODBMS is based on three major components, namely: Object structure, Object classes, and Object
identity. These are explained below.
1. Object Structure:
The structure of an object refers to the properties that an object is made up of. These properties of an
object are referred to as an attribute. Thus, an object is a real-world entity with certain attributes that
makes up the object structure. Also, an object encapsulates the data code into a single unit which in
turn provides data abstraction by hiding the implementation details from the user.
The object structure is further composed of three types of components: Messages, Methods, and
Variables. These are explained below.
Messages
A message provides an interface or acts as a communication medium between an object and the outside
world. A message can be of two types:
Read-only message: If the invoked method does not change the value of a variable, then the invoking
message is said to be a read-only message.
Update message: If the invoked method changes the value of a variable, then the invoking message is
said to be an update message.
Methods
When a message is passed then the body of code that is executed is known as a method. Whenever a
method is executed, it returns a value as output. A method can be of two types:
Read-only method: When the value of a variable is not affected by a method, then it is known as the
read-only method.
Update-method: When the value of a variable change by a method, then it is known as an update
method.
Variables
It stores the data of an object. The data stored in the variables makes the object distinguishable from
one another.
2. Object Classes:
An object which is a real-world entity is an instance of a class. Hence first we need to define a class and
then the objects are made which differ in the values they store but share the same class definition. The
objects in turn correspond to various messages and variables stored in them.
Example
class CLERK
{//variables
char name;
string address;
int id;
int salary;
// Messages
char get_name();
string get_address();
int annual_salary();
};
In the above example, we can see, CLERK is a class that holds the object variables and messages.
An OODBMS also supports inheritance in an extensive manner as in a database there may be many
classes with similar methods, variables and messages. Thus, the concept of the class hierarchy is
maintained to depict the similarities among various classes.
The concept of encapsulation that is the data or information hiding is also supported by an object-
oriented data model. And this data model also provides the facility of abstract data types apart from the
built-in data types like char, int, float.
Thus, OODBMS provides numerous facilities to its users. It incorporates the properties of an object-
oriented data model with a database management system, and supports the concept of programming
paradigms like classes and objects along with the support for other concepts like encapsulation,
inheritance.
ODBMS have several advantages over traditional relational databases. One of the main advantages is
that they provide a natural way to represent complex data structures and relationships. Since the data is
represented using objects, it can be easier to model real-world entities in the database. Additionally,
ODBMS can provide better performance and scalability for applications that require a large number of
small, complex transactions.
However, there are also some disadvantages to using an ODBMS. One of the main disadvantages is that
they can be more complex and harder to use than traditional relational databases. Additionally, ODBMS
may not be as widely used and supported as traditional relational databases, which can make it harder
to find expertise and support. Finally, some applications may not require the advanced features and
performance provided by an ODBMS, and may be better suited for a simpler database solution
Features of ODBMS:
Object-oriented data model: ODBMS uses an object-oriented data model to store and manage data.
This allows developers to work with data in a more natural way, as objects are similar to the objects in
the programming language they are using.
Complex data types: ODBMS supports complex data types such as arrays, lists, sets, and graphs,
allowing developers to store and manage complex data structures in the database.
Automatic schema management: ODBMS automatically manages the schema of the database, as the
schema is defined by the classes and objects in the application code. This eliminates the need for a
separate schema definition language and simplifies the development process.
High performance: ODBMS can provide high performance, especially for applications that require
complex data access patterns, as objects can be retrieved with a single query.
Data integrity: ODBMS provides strong data integrity, as the relationships between objects are
maintained by the database. This ensures that data remains consistent and correct, even in complex
applications.
Concurrency control: ODBMS provides concurrency control mechanisms that ensure that multiple users
can access and modify the same data without conflicts.
Scalability: ODBMS can scale horizontally by adding more servers to the database cluster, allowing it to
handle large volumes of data.
Support for transactions: ODBMS supports transactions, which ensure that multiple operations on the
database are atomic and consistent.
Advantages
Supports Complex Data Structures: ODBMS is designed to handle complex data structures, such as
inheritance, polymorphism, and encapsulation. This makes it easier to work with complex data models
in an object-oriented programming environment.
Improved Performance: ODBMS provides improved performance compared to traditional relational
databases for complex data models. ODBMS can reduce the amount of mapping and translation
required between the programming language and the database, which can improve performance.
Reduced Development Time: ODBMS can reduce development time since it eliminates the need to map
objects to tables and allows developers to work directly with objects in the database.
Supports Rich Data Types: ODBMS supports rich data types, such as audio, video, images, and spatial
data, which can be challenging to store and retrieve in traditional relational databases.
Scalability: ODBMS can scale horizontally and vertically, which means it can handle larger volumes of
data and can support more users.
Disadvantages
Limited Adoption: ODBMS is not as widely adopted as traditional relational databases, which means it
may be more challenging to find developers with experience working with ODBMS.
Lack of Standardization: ODBMS lacks standardization, which means that different vendors may
implement different features and functionality.
Cost: ODBMS can be more expensive than traditional relational databases since it requires specialized
software and hardware.
Integration with Other Systems: ODBMS can be challenging to integrate with other systems, such as
business intelligence tools and reporting software.
Scalability Challenges: ODBMS may face scalability challenges due to the complexity of the data models
it supports, which can make it challenging to partition data across multiple nodes.
ODBMS have several advantages over traditional relational databases. One of the main advantages is
that they provide a natural way to represent complex data structures and relationships. Since the data is
represented using objects, it can be easier to model real-world entities in the database. Additionally,
ODBMS can provide better performance and scalability for applications that require a large number of
small, complex transactions.
However, there are also some disadvantages to using an ODBMS. One of the main disadvantages is that
they can be more complex and harder to use than traditional relational databases. Additionally, ODBMS
may not be as widely used and supported as traditional relational databases, which can make it harder
to find expertise and support. Finally, some applications may not require the advanced features and
performance provided by an ODBMS, and may be better suited for a simpler database solution
Application of OODBMS and examples
OODBMSs are well suited for handling complex, unstructured, or semi-structured data, and are often
used in applications such as engineering, geographic information systems, and multimedia. Some
popular examples of OODBMSs include MongoDB, Apache Cassandra, and ObjectDB.
Object Identity
The identity of An object is its being distinct from any other object, regardless of the values of the
objects' properties. Having identity is a fundamental property of objects.
Object identity is a property of data that is created in the context of an object data model, where an
object is assigned a unique internal object identifier, or OID. The object identifier is used to define
associations between objects and to support retrieval and comparison of object-oriented data based on
the internal identifier rather than the attribute values of an object.
Object Data Management System (ODMS) assigns unique identity to each independent object stored in
the database. This unique identity is implemented through a system-generated object identifier (OID).
This OID serves as distinct value assigned to each object by the system. It is not visible to external
users.1
Differences between RDBMS AND OODBMS
RDBMS and OODBMS are database management systems. RDBMS uses tables to represent data and
their relationships whereas OODBMS represents data in form of objects similar to Object Oriented
Programming.
Following are the important differences between RDBMS and OODBMS.
Sr. Key RDBMS OODBMS
No.
Definition RDBMS stands for OODBMS stands for Object
1 Relational Database Oriented Database
Management System. Management System.
Data Data is stored as Data is stored as objects.
2 Management entities defined in
tabular format.
Data Complexity RDBMS handles simple OODBMS handles large and
3
data. complex data.
Term An entity refers to A class refers to group of
collection of similar objects having common
4
items having same relationships, behaviors and
definition. properties.
Data Handling RDBMS handles only OODBMS handles both data
5 data. and functions operating on
that data.
Sr. Key RDBMS OODBMS
No.
Objective To keep data To implement data
6 independent from encapsulation.
application program.
Key A primary key identifies Object Id, OID represents an
7 in object in a table object uniquely in group of
uniquely. objects.