Introduction To Object Oriented Database: Unit-I
Introduction To Object Oriented Database: Unit-I
Introduction To Object Oriented Database: Unit-I
UNIT-I
Introduction to Object Oriented Database
RDBMS
• Specialization
• Generalization
Specialization
• Specialization is a process in which an entity is divided into sub-entities.
• The idea behind Specialization is to find the subsets of entities that have few
distinguish attributes.
Generalization
• Generalization is a process in which the common attributes of more than one entities form a new entity.
Example
• we have two entities Student and Teacher.
• Attributes of Entity Student are: Name, Address & Grade
• Attributes of Entity Teacher are: Name, Address & Salary
Encapsulation
• Encapsulation: An object contains both current state (Attributes) and set of methods used
to manipulate it. It is called encapsulation.
• Importance: These two concepts support the facility that internal properties of an object to
be changed without affecting applications that use it, provided external properties remain
same. It also provides data independence.
Abstraction
• It’s the process of identifying the essential aspects of an entity and ignoring the
unimportant properties.
• It has two fundamentals
• Encapsulation
• Data Hiding
Inheritance
• Only tables that are defined on named row types support table inheritance.
• Table inheritance is the property that allows a table to inherit the behavior
(constraints, storage options, triggers) from the super table.
• A table hierarchy is the relationship that you can define among tables in which
sub tables inherit the behavior of super tables.
• A table inheritance provides the following advantages:
• It encourages modular implementation of your data model.
• It ensures consistent reuse of schema components.
• It allows you to construct queries whose scope can be some or all of the tables in the
table hierarchy
Polymorphism
Dynamic binding
• Object oriented provides facility to specify that the compiler should match function calls with the correct
definition at the run time; this is called dynamic binding or late binding or run-time binding.
• Dynamic binding is achieved using virtual functions.
• Base class pointer points to derived class object.
Dynamic Binding
• An Object Oriented Data Model(OODM) has been defined for logical database
design and database access.
• The OODM three types of relationships.
• Aggregation, Generalization and specifications.
• It provides four types of data operations defining schema, creating database,
retrieving objects and expanding objects.
• In OODM both data and their relationship are contained in a single structure
known as object.
Types of object based Data Models
• The OODM supports a structured menu based interface which allows a user
define the schema and retrieve from the database without any knowledge of the
OODM.
• An important features of this interface is that menu information is modelled as
set of interrelated objects stored in the database.
Object Identity
create type Department ( name varchar (20), head ref (Person) scope people)
• Drawbacks:
• (1) Powerful but easy to make programming errors that damage the database;
• (2) harder to do automatic high-level optimization; and
• (3) do not support declarative querying well .
Object Relational Mapping.
• Object-Relational Mapping (ORM) systems built on top of traditional relational
databases
• Implementor provides a mapping from objects to relations
• Objects are purely transient, no permanent object identity
• Objects can be retried from database
• System uses mapping to fetch relevant data from relations and construct objects
• Updated objects are stored back in database by generating corresponding
update/insert/delete statements
• The Hibernate ORM system is widely used
• Provides API to start/end transactions, fetch objects, etc
• Provides query language operating directly on object model
• queries translated to SQL
• Limitations: overheads, especially for bulk update