Object oriented database (OODB):- - PowerPoint PPT Presentation

About This Presentation
Title:

Object oriented database (OODB):-

Description:

Object oriented database (OODB):-Object oriented database (OODB) are dependent on the object oriented programming paradigm. It enable us to create classes, organize ... – PowerPoint PPT presentation

Number of Views:268
Avg rating:3.0/5.0
Slides: 17
Provided by: siom
Category:

less

Transcript and Presenter's Notes

Title: Object oriented database (OODB):-


1
  • Object oriented database (OODB)-
  • Object oriented database (OODB) are dependent
    on the object oriented programming paradigm. It
    enable us to create classes, organize object,
    structure an inheritance hierarchy and call
    methods of other classes. Beside these it also
    provides the facilities associated with standard
    database systems. However object oriented
    database system have not yet replaced the RDBMS
    in commercial business applications.
  • Although a relational database can be used
    to store and manage object, it does not
    understand objects as such. Therefore, a middle
    layer called object manager or object-oriented
    layer software is required to translate object
    into tuples of a relation.

2
  • Different approaches for designing an object
    oriented database
  • Designed to store, retrieve and manage objects
    created by programs written in some object
    oriented languages (OOL) such as C or Java.
  • Designed to provide object oriented facilities to
    user of non object-oriented programming languages
    (OOPLs) such as C or Pascal
  • The user will create classes, objects,
    inheritance hierarchy, and so on and the database
    system will store and manage these objects and
    classes. This second approach, thus turns
    non-OOPLs into OOPLs. A translation layer is
    required to map the object created by user into
    objects of the database system

3
  • Storing and Accessing objects-
  • The data part of all objects of a class are
    stored individually in a database. The program
    part of the class are stored as part of the
    database schema along with the type definitions
    of the classes
    Objects can also be given names
    to allow their access. However, such an approach
    will not work hen the number of objects in a
    database are large in numbers say in the range of
    millions. Another method is to collect object
    into a group. a group is given a name. The
    programs will then iterate over a group to find
    out the required object.
  • A special case of a collection is the
    class-extent. A class-extent is the objects
    belonging is the collection of all the objects
    belonging to a class. Whenever a new object needs
    to inserted be inserted into a class it is
    inserted into its class-extent automatically.
    Similarly, whenever a new object need to be
    deleted, it is deleted from the respective class
    extent.

4
  • A sample object oriented database-
  • A sample object oriented is shown in figure
  • The solid lines(-) in the figure represents
    class-subclass link. The dash(---) represents
    attribute domain link. The class vehicle is the
    root of a class composition hierarchy that
    involves vehicle specs and company. The class
    vehicle is also the root of a class hierarchy
    that involves the subclasses two wheeler and four
    wheeler. The class company is in turn the root of
    a class hierarchy that involves the subclasses
    Domestic company and foreign company. It is also
    the root of a class composition hierarchy that
    involve the class employees

5
Object Oriented Database (OODB)-
Vehicle specs
Vehicle
Length Width Height Type Fuel
Code Color Specifications Manufacturer
Employee
Four Wheeler
Company
Two Wheeler
Gear Seating type No_ of_ doors
Company _name President Place
Emp _Code Emp_ Name Age
Gear Seating type
Foreign Company
Domestic company
Dom _Com_ name Dom_ president Dom Place
For _Com_ name For_ president For Place
6
  • Advantages of OODBMS over RDBMS-
  • RDBMS does not allow nested structure. nested
    structure applications are found in CAD/CAE,
    aerospace science, etc. It is easier to navigate
    through these complex structures in the firm of
    objects rather than in the from of table and
    records.
  • Relational database have only a limited number of
    data type like integer, char, text, etc. although
    we can create complex data types in relational
    database by combining fields, these are
    restricted by their base data type and sub
    classing with inheritance.
  • Object oriented database are favored in those
    application where the relationship among data
    elements are more important than data items
    themselves. However, relational database are used
    in those applications where the values of data
    elements are more important. If a record makes
    sense only when used in context of other records,
    then an object oriented database would be more
    appropriate.

7
  • Distributed DBMS(DDBMS)-
  • Some organization use distributed database system
    rather than a centralized database. In the
    centralized database system data resides in one
    single location. But in a distributed database
    system, database is stored in several computers.
    The computers in a distributed system
    communication and exchange data among one other
    using leased lines, telephone lines or other
    means of communication. These computers do not
    share memory or clock. Each of the computers in a
    distributed system. Participates in the execution
    of transactions. These computer can also be known
    as sites or nodes.

8
  • Advantages of distributed database-
  • Data sharing since data is distributed on
    multiple computers, user operating on one
    computer can work on data available on any
    another computer.
  • Distributed control- unlike centralizes database
    system, where a single database administrator
    controls the database, in a distributed system
    responsibility of control is divided among local
    administrators for each computer thus local
    administrators have a certain degree of control
    over the database stored locally.
  • Reliability and Availability- Even if one site
    fails in the distributed system the remaining
    site can continue working. If data is replicated
    among multiple computers, failure of any one
    computer does not case shutdown of the entire
    database system
  • Faster Query processing- Queries involving data
    at several sites can be split into sub queries
    can then be executed in parallel by several
    sites, such a parallel computation allows faster
    processing.

9
  • Disadvantages of distributes database-
  • Increase cost- it is more difficult to develop
    software packages to implement distributed
    database system. Also cost involved in physically
    linking different sites
  • More Error prone-since the sites that comprise
    distributed database system operate in parallel,
    it is very difficult to ensure the correctness of
    data. The algorithms are more error prone and
    have greater potential for bugs,
  • Increased overhead- maintaining physical links
    between the sites and exchanging messages among
    computer is an additional overhead associated
    with distributed systems that are absent in the
    case of centralized system

10
  • Advantages of DBMS-
  • It represents complex relationships among
    different data items.
  • Keeps tight control on data redundancy.
  • Enforces user defined rules to ensure the
    integrity of data in a table from.
  • Maintains data dictionary for the storage of
    information pertaining to data fields and data
    manipulation.
  • Ensure that data can be shared across all
    applications.
  • Enforces data access authorization
  • Has an automatic intelligent backup and recovery
    procedure of data.
  • Has different interfaces through which user can
    manipulated data.

11
Object Oriented database- Different Flavors of
ORACLE available Relational- The traditional
ORACLE relation Database (RDBMS). Object-relation
al- The traditional ORACLE relational
database, Extended to include Object-oriented
concepts and structures such as abstract data
type, nested tables, and varying
arrays Familiarity with the function and
features of the core Oracle relational
database Object-oriented- An object-oriented
database whose design in based solely on
Object-Oriented Analysis and Design
principles OO capabilities are used the
functions and data types available in oracle as
well as its programming languages( SQL and
Pl/SQL).
12
  • Why should objects be used-
  • Object reduce complexity by giving an intuitive
    way of representing complex data and its
    relations.
  • Besides simplifying the interaction with data,
    object may help in other ways.
  • OO features are-
  • Object reuse
  • Standards adherence
  • Object types-
  • Abstract Data type- abstract data types is a
    data type that consists of one or more subtypes
  • Example- address
  • Street Vrachar2(50)
  • City Varchar2(25)
  • State Varchar2(25)
  • Zip Number

13
  • Naming conventions for objects-
  • When working with OO the following rules should
    be enforced
  • Table and column name will be Singular(such as
    EMPLOYEES, Name, and State)
  • Abstract data type name will be singular nouns
    with a _TY suffix (such as PERSON_TY or
    ADDRESS_TY)
  • Table and Data type name will always be uppercase
    (such as EMPLOYEE OR PERSON_TY).

14
Create type address_ty as object (street
varchar2(50), city varchar2(25), state
varchar2(25), zip number) Create type command
note the as object clause. The as object clause
explicitly identifies address_ty as an OO
implementation. Create type person_ty as
object (name varchar2(25), address
address_ty) The following command creates a
table named customer. A customer has a cutomer_id
and all the attributes of a person ( via the
person_ty datatype) create table
customer (customer_id number,person
person_ty) desc customer desc person_ty
desc address_ty
15
select column_name,data_type from
user_tab_columns select column_name,data_type
from user_tab_columns where table_name'CUSTOMER'
select attr_name,length,attr_type_name from
user_type_attrs where type_name'PERSON_TY' sele
ct attr_name,length,attr_type_name from
user_type_attrs where type_name'ADDRESS_TY' Ins
erting records into the Customer table insert
into customer values(1, person_ty('Mahesh',address
_ty('Dadar','Mumbai','Maharashtra',416313))) ins
ert into customer values(2, person_ty('Vaishali',a
ddress_ty('Kurla','Mumbai','Maharashtra',416315)))
select customer_id from customer select
from customer select customer_id,client.person.n
ame from customer client
16
select client.person.address.street from customer
client select client.person.name,
client.person.address.city from customer client
where client.person.address.city like 'M'
Write a Comment
User Comments (0)
About PowerShow.com