object oriented database by liem do and jesslyn bui

23
Object Oriented Database By Liem Do And Jesslyn Bui

Upload: kerry-todd

Post on 16-Jan-2016

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Object Oriented Database By Liem Do And Jesslyn Bui

Object Oriented Database

By Liem DoAnd Jesslyn Bui

Page 2: Object Oriented Database By Liem Do And Jesslyn Bui

History of Databases

File Systems (1950s)

hierarchical/ network (1960s) relational (1970-80s) 

ODBMS (1990s-today)

Store data after process created it has ceased to exist

 Concurrency, recovery  Complex structures , fast access

More reliability, less redundancyMore flexibility, multiple views 

Better simulation, more and complex data types, more relationships (e.g.aggregation, specialization)  Single language for database AND

programming, no 'reconstruction' of objects 

Page 3: Object Oriented Database By Liem Do And Jesslyn Bui

OBJECT-ORIENTED DATABASES

What is an Object Oriented Database?Comparison with traditional DatabasesAdvantagesDisadvantagesCode ExampleMyths about Object Oriented DatabasesCommercial ODBMS availableReal Life uses of ODBMS in Industry

Page 4: Object Oriented Database By Liem Do And Jesslyn Bui

What is Object Oriented Database (OODB)?

OODB = Object Orientation + Database Capabilities

Provides data and object persistenceRepresentation of complex data modelsIntegrates database capabilities with object programming language capabilites

Page 5: Object Oriented Database By Liem Do And Jesslyn Bui

Transparent persistence

Page 6: Object Oriented Database By Liem Do And Jesslyn Bui

Complex data

Complex data is often characterized by:

A lack of unique, natural identification. A large number of many-to-many

relationships. Access using traversals. Frequent use of type codes such as those

found in the relational schema

Page 7: Object Oriented Database By Liem Do And Jesslyn Bui
Page 8: Object Oriented Database By Liem Do And Jesslyn Bui

Database Models

ObjectRelational Object Relational

Page 9: Object Oriented Database By Liem Do And Jesslyn Bui

Object Model

Three concepts are critical

to understanding object models. They are:

Data abstractionEncapsulationInheritance

Page 10: Object Oriented Database By Liem Do And Jesslyn Bui

Relational Model

Page 11: Object Oriented Database By Liem Do And Jesslyn Bui

Comparison

Page 12: Object Oriented Database By Liem Do And Jesslyn Bui

Mapping

Page 13: Object Oriented Database By Liem Do And Jesslyn Bui

Comparison of object and relational terminology

Page 14: Object Oriented Database By Liem Do And Jesslyn Bui

Relational Database of a Cat

Page 15: Object Oriented Database By Liem Do And Jesslyn Bui

Object-Oriented Database of a Cat

Page 16: Object Oriented Database By Liem Do And Jesslyn Bui

OODB enables complex data types to be stored (e.g. CAD applications)

Page 17: Object Oriented Database By Liem Do And Jesslyn Bui

Object Relational Model

It handles the mapping and has a cache much like an ODBMS.

Data is mapped to the ODBMS and from the ODBMS based on the application needs.

The ODBMS provides high-speed performance for the Internet.

Page 18: Object Oriented Database By Liem Do And Jesslyn Bui

Advantages

Uses object oriented features for data storage.

Provides transparent object persistence

Allows ability to store complex data

High performanceSingle data model

Page 19: Object Oriented Database By Liem Do And Jesslyn Bui

Disadvantages

Lack of FamiliarityInertiaTechnology FearBusiness Fear

Page 20: Object Oriented Database By Liem Do And Jesslyn Bui

Java Code Example

import org.odmg.*;import java.util.Collection;Implementation impl = new com.vendor.odmg.Implementation();Database db = impl.newDatabase();Transaction txn = impl.newTransaction();try { db.open("addressDB", Database.OPEN_READ_WRITE);

txn.begin(); // perform query OQLQuery query = new OQLQuery("select x from Person x where x.name

= \"Doug Barry\""); Collection result = (Collection) query.execute(); Iterator iter = result.iterator(); // iterate over the results while ( iter.hasNext() ) {

Person person = (Person) iter.next(); // do some addition processing on the person (now shown) // now traverse to the address object and update its value

person.address.street = "13504 4th Avenue South";

} txn.commit(); db.close();

}

Page 21: Object Oriented Database By Liem Do And Jesslyn Bui

Has a steep learning curve Slow Do not support queries Do not scale

Myths about OODB

Page 22: Object Oriented Database By Liem Do And Jesslyn Bui

Commercial ODBMS Available

Objectivity ObjectStore Goods Versant

Page 23: Object Oriented Database By Liem Do And Jesslyn Bui

Real Life uses of ODBMS in Industry

trade stock use Internet trade use your pager use your voicemail book a flight use your PCS phone