What are different concepts and features of object-oriented databases? What is object relational model?
OBJECT-ORIENTED DATABASE CONCEPTS
- Object-oriented databases (OODB) are databases that represent data in the form of objects and classes. In object-oriented terminology, an object is a real-world entity, and a class is a collection of objects.
- Object-oriented databases follow the fundamental principles of object-oriented programming (OOP). The combination of relational model features (concurrency, transaction, and recovery) with object-oriented principles results in an object-oriented database model.
- Object-oriented databases add the database functionality to object programming languages, creating more manageable code bases.
- The main goal of object-oriented databases is to combine the advantages of object-oriented technologies and traditional (relational) databases.
- Itasca
- 02
- Versant
FUNDAMENTAL FEATURES OF OBJECT-ORIENTED DATABASE
There is a certain set of basic concepts, supported by each object-oriented database system. These basic concepts are objects and identity, encapsulation, classes and instantiation, inheritance and overloading, overriding and late binding.
Objects and Identity
- In an object-oriented database, each real-world entity is represented by an object. This object has a state and behavior. The combination of the current values of an object's attributes defines the object's state. A set of methods, acting on an object's state, define the object's behavior.
- For example, let us consider a real-world entity called 'Student'. A student has states or properties such as a name, USN, date of birth, address, etc. Similarly, the student has behaviors or methods including attending classes, writing exams, paying fees, etc.
- When it comes to identity, each object in the database is defined by a unique object identifier.
Encapsulation
- Encapsulation is an important object-oriented feature. This hides the implementation details from the end-users and displays only the needed descriptions. For example, imagine that you are buying soap from a commercial store. You know its ingredients such as color and fragrance by looking at the box, but you aren't shown the actual method used to manufacture the soap.
- Encapsulation is a basic concept for all object-oriented technologies. It was created for making a clear distinction between the specification and the implementation of an operation and in this way for enabling modularity. Software that exceeds a certain size needs some sort of modular architecture for enabling design, implementation, and maintenance to be executed by a larger group of programmers.
Classes and Instantiation
- A class is a set of objects that have the exact same internal structure. In that way, a class defines the implementation of an object and a type describes the way the object can be used.
- The term instantiation aims at the fact that a class definition can be used to generate a set of objects that share the same structure and behavior. A class specifies a structure (a set of attributes), a set of operations, and a set of methods, which implement the operations.
- A feature, which is very important to the evolution of objects, is that an object can change its class. This means that an object can change its attributes and operations while keeping the same identity. Enabling class changes comes with the need for a mechanism for handling semantic integrity problems that may arise. Applications must deal with exceptions that may arise when an object is referred to as an instance of a class, different from the one expected.
Inheritance
- Inheritance makes it possible to define a class as a subclass of an already existing one (superclass). The subclass inherits all attributes and methods from the superclass and can additionally define its own attributes and methods.
- This concept is an important mechanism for supporting reusability. Identical parts of the structure of two different classes may be defined only once in a common superclass. In this way, less code has to be written. There are some systems that allow a class to be a subclass of more than one superclass. This feature is called multiple inheritances (in contrast to single inheritance).
Overloading, Overriding and Late binding.
- Method Overloading is a Compile time polymorphism. In method overloading, more than one method shares the same method name with a different signature in the class. In method overloading, the return type can or can not be the same, but we have to change the parameter because, in java, we can not achieve the method overloading by changing only the return type of the method. OR,
- Having methods of the same name and different signatures in scope, or we can say in a class, is known as method overloading. The unique signature of a method indicates that either it has a different number of parameters or different data types of parameters.
- Its purpose is to increase the readability of the code, as different methods performing the same action can have the same name but a different number of arguments or different types of arguments, and to achieve compile-time polymorphism.
- Method Overriding is a Run time polymorphism. In method overriding, the derived class provides the specific implementation of the method that is already provided by the base class or parent class. In method overriding, the return type must be the same or co-variant (return type may vary in the same direction as the derived class). OR,
- Having two or more methods with the same name and signature as the method in the parent class is known as method overriding. Method overriding allows us to invoke functions from base class to derived class. So, we can also say that a technique that includes creating a method in the derived class that has the same name and signature as the method in the base class is known as method overriding.
- Its purpose is to achieve run-time polymorphism and to change the existing functionalities.
- The feature that provides disables the system to bind names of operations to the corresponding methods at compile time. The delayed binding of operation names to the corresponding methods at run-time is called 'late binding'.
Object-relational model
- Object-relational model is a combination of a Object-oriented database model and a Relational database model. So, it supports objects, classes, inheritance etc. just like Object Oriented models and has support for data types, tabular structures etc. like Relational data model.
- One of the major goals of Object relational data model is to close the gap between relational databases and the object oriented practises frequently used in many programming languages such as C++, C#, Java, etc.
Comments
Post a Comment