Top Banner
what is object oriented database ? ODBMS An object-oriented database management system (OODBMS), sometimes shortened to ODBMS for object database management system, is a database management system (DBMS) that supports the modelling and creation of data as objects.
30
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: odbms

what is object oriented database ?

ODBMS

An object-oriented database management system (OODBMS), sometimes shortened to ODBMS for object database management system, is a database management system (DBMS) that supports the modelling and creation of data as objects.

Page 2: odbms

ODBMS

ODBMS includes some kind of support for classes of objects and the inheritance of class properties and methods by subclasses and their objects.

There is currently no widely agreed-upon standard for an OODBMS, and OODBMS products are considered to be still in their imature stage.

Page 3: odbms

In the meantime, the object-relational database management system (ORDBMS), the idea that object-oriented database concepts can be superimposed on relational databases, is more commonly available products.

An object-oriented database interface standard is being developed by an industry group, the Object Data Management Group (ODMG).

ODBMS

Page 4: odbms

ODBMS

Object Data Management Group has set a standard for Object Databases (version 3.0).

ODL - Object Definition Language

OML - Object Manipulation Language

Page 5: odbms

Typical Applications for ODBMS:- Computer-aided design (CAD)- Computer-aided software engineering

(CASE)- Multimedia databases

--- Images, video, games, etc.

- Office automation systems (OIS)- Expert database systems

ODBMS

Page 6: odbms

OBJECT STRUCTURE

Objects basically consist of the following:

Attributes - Attributes are data which defines the characteristics of an object. This data may be simple such as integers, strings, and real numbers or it may be a reference to a complex object.

Methods - Methods define the behavior of an object and are what was formally called procedures or functions.

ODBMS

Page 7: odbms

Attributes Contain current state of an object.

Attributes can be classified as simple or complex.

Simple attribute can be a primitive type such as integer, string, etc., which takes on literal values.

Complex attribute can contain collections and/or references.

Reference attribute represents relationship.

An object that contains one or more complex attributes is called a complex object.

ODBMS

Page 8: odbms

Object Identity

Object identifier (OID) assigned to object when it is created that is:

– System-generated.

– Unique to that object.

– Invariant.

– Independent of the values of its attributes (that is, its state).

– Invisible to the user (ideally).

ODBMS

Page 9: odbms

Object Identity - Implementation In RDBMS, object identity is value-based: primary key is used to provide uniqueness.

Primary keys do not provide type of object identity required in OO systems:

- key only unique within a relation, not across entire system;

- key generally chosen from attributes of relation, making it dependent on object state.

ODBMS

Page 10: odbms

Methods and Messages

Method

– Defines behavior of an object, as a set of encapsulated functions.

Message

– Request from one object to another asking second object to execute one of its methods.

ODBMS

Page 11: odbms

ODBMS

Object Showing Attributes and Methods

Page 12: odbms

Class Instance Share Attributes and Methods

Page 13: odbms

Subclasses, Superclasses, and Inheritance

• All instances of subclass are also instances of superclass.

• Principle of substitutability states that instance of subclass can be used whenever method/construct expects instance of superclass.

• Relationship between subclass and superclass known as A KIND OF (AKO) relationship.

• Four types of inheritance: single, multiple, repeated, and selective.

ODBMS

Page 14: odbms

Single Inheritance

ODBMS

Page 15: odbms

Multiple Inheritance

ODBMS

Page 16: odbms

Repeated Inheritance

ODBMS

Page 17: odbms

Class Hierarchy

class person{

string name;string address:};

class customer isa person {int credit-rating;};

class employee isa person {date start-date;int salary;};

class officer isa employee {int office-number,int expense-account-

number,};

Page 18: odbms

ODBMS

OODBMS vs RDBMS RDBMS have been around for more than 20 years, OODBMS are relatively new.

RDBMS can handle >1010 records, OODBMS up to 107.

OODBM good for storing complex descriptions (e.g., a plant schematic), RDBMS appropriate for simple, “flat” data.

Page 19: odbms

RDBMS control the DB market (>90%), OODBMS own <5% of the market.

Most commercial RDBMS come with an “Object-Relational” extension which implements an object database on top of a RDBMS.

OODBMS vs RDBMS

ODBMS

Page 20: odbms

InheritanceType hierarchy

- System permits the definition of new types based on other existing types– A subtype inherits all properties of its supertype

– A sub-class C’ of a class C is a collection of objects such that each object in C’ is also an object in C.– An object in C’ inherits all properties of C

Class hierarchy

- Multiple inheritance (inherits from more than just one superclass)- Selective inheritance (inherits only some of the properties of a superclass)

ODBMS

Page 21: odbms

Persistent Programming languages allow objects to be created and stored in a database, and used directly from a programming language

Allow data to be manipulated directly from the programming language

- No need to go through SQL.

Persistent Programming LanguagesPersistent Programming Languages

Page 22: odbms

No need for explicit format (type) changes

- Format changes are carried out transparently by system

- Without a persistent programming language, format changes becomes a burden on the programmer

– More code to be written

– More chance of bugs

Persistent Programming LanguagesPersistent Programming Languages

Page 23: odbms

Allow objects to be manipulated in-memory

- no need to explicitly load from or store to the database

- Saved code, and saved overhead of loading/storing large amounts of data

Persistent Programming LanguagesPersistent Programming Languages

Page 24: odbms

Drawbacks of persistent programming languages

Due to power of most programming languages, it is easy to make programming errors that damage the database.

Complexity of languages makes automatic high-level optimization more difficult.

Do not support declarative querying as well as relational databases

Persistent Programming LanguagesPersistent Programming Languages

Page 25: odbms

Declarative query languageNot computationally complete

Syntax based on SQL (select, from, where)

Additional flexibility (queries with user defined operators and types)

Object Query Language (OQL)

ODBMS

Page 26: odbms

The following is a sample query

“what are the names of the black product?”

Select distinct p.name

From products p

Where p.color = “black”

Valid in both SQL and OQL, but results are different.

ODBMS

Example of OQL query

Page 27: odbms

Result of the query (SQL)

Product no Name Color

P1 Ford Mustang Black

P2 Toyota Celica Green

P3 Mercedes SLK Black

- The statement queries a relational database.

=> Returns a table with rows.

Name

Ford MustangMercedes SLK

Result

Original table

Example of OQL query

Page 28: odbms

Product no Name Color

P1 Ford Mustang Black

P2 Toyota Celica Green

P3 Mercedes SLK Black

String

Ford Mustang

Result

Original table

String

Mercedes SLK

Result of the query (SQL)

- The statement queries a object-oriented database

=> Returns a collection of objects.

Example of OQL query

Page 29: odbms

Queries look very similar in SQL and OQL, sometimes they are the same

In fact, the results they give are very different

Query returns:

OQL SQLObjectCollection of objects

TupleTable

Comparison

Page 30: odbms

Foundation for several OO database management systems – ORACLE8, DB2, etc

New features – “relational” & “Object oriented”

Relational Features – new data types, new predicates, enhanced semantics, additional security and an active database

Object Oriented Features – support for functions and procedures

SQL3 “Object-oriented SQL”