ObjectRelational Database Model - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

ObjectRelational Database Model

Description:

Data independence. High-level approach. Standardization. Built-in ... A first course in database systems, Jeffrey D. Ullman, Jennifer Widom, Prentice Hall 2002 ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 25
Provided by: asdf74
Category:

less

Transcript and Presenter's Notes

Title: ObjectRelational Database Model


1
ObjectRelational Database Model
  • Conceptual Data Modeling Jonas Chapuis

2
Foreword
  • Object databases will gain ground, but their
    share of the worlds data will still be very
    small.
  • The big change will come from the relational
    databases as they extend their databases to
    support more object-oriented features.
  • Martin Fowler, Oracle Press, 1999

3
Outline
  • History
  • Main Features
  • Commercial Solutions
  • Summary

4
History of DB Models
  • 1950 File Systems, Punched Cards
  • 1960 Hierarchical
  • (IMS IBM Mainframes)
  • 1970 Network
  • (CODASYL, IDMS)
  • 1980 Relational
  • (ORACLE, DB2, Sybase)
  • 1990 Object-Oriented, Object-Relational
  • (O2, ORACLE9i)

5
Relational Model
  • Emergence of data model
  • Data independence
  • High-level approach
  • Standardization
  • Built-in data types
  • Little abstraction
  • Separation between data and operations

6
Object-Oriented Model
  • Complex application datatypes
  • Object Abstraction
  • Encapsulation of behavior
  • High performance for specific application
  • No backwards compatibility
  • Closely tied to language and application

7
Object-Relational Model
  • Synthesis of two worlds
  • Upward compatibility
  • Robustness of mature systems
  • Hybrid approach
  • Legacy problems

8
Main Features
  • Relation is still the fundamental abstraction,
    with integration of OO features
  • Structured Types
  • Non-atomic types
  • Methods
  • Special operations can be defined for a type
  • References
  • Pointers to tuples

9
Structured Types - I
  • Attributes of relation schemas can be
  • Atomic
  • Relation schemas Nested Relations

10
Structured Types - II
Nested
4NF
1NF
11
Structured Types SQL99
  • UDT User Defined Type
  • A UDT can be the type of a table
  • A UDT can be the type of an attribute belonging
    to some table
  • A UDT can inherit from another UDT
  • CREATE TYPE T AS ltattribute and method
    declarationsgt

12
Nested Relations SQL99 Example
  • CREATE TYPE AddressType AS (
  • street CHAR(50),
  • city CHAR(20)
  • )
  • CREATE TYPE AddressTypeTable
  • AS TABLE OF AddressType
  • CREATE TYPE StarType AS (
  • name CHAR(30),
  • address AddressTypeTable
  • )
  • CREATE TABLE MovieStar OF StarType

13
Methods SQL99
  • Special operations defined for a type
  • In SQL, implementation defined with Presistent
    Stored Modules (PSM) language
  • METHOD m() RETURNS ltTYPEgt

14
Methods SQL99 - Example
  • CREATE TYPE AddressType AS (
  • street CHAR(50),
  • city CHAR(20)
  • )
  • METHOD houseNumber() RETURNS CHAR(10)
  • CREATE METHOD houseNumber() RETURNS CHAR(10) FOR
    AddressType
  • BEGIN
  • END

15
References - I
  • Allow a tuple t refer to a tuple s rather than
    including s in t

16
References - II
  • If attribute A has a type that is a reference to
    a tuple in relation with schema R, we denote A as
    A(R)
  • If A is a set of references, we denote A as
    A(R)

17
References SQL99 - I
  • A table which type is a UDT may have a reference
    column that serves as its ID
  • In CREATE TABLE statement, add
  • REF IS ltattribute namegt lthow generatedgt
  • Where lthow generatedgt is either
  • SYSTEM_GENERATED DBMS generates unique IDs
  • DERIVED DBMS uses primary key of the relation
    for IDs

18
References SQL99 I - Example
  • CREATE TYPE MovieType AS (
  • title CHAR(30),
  • year INTEGER
  • )
  • CREATE TABLE Movie OF MovieType (
  • REF IS movieID DERIVED,
  • PRIMARY KEY (title, year)
  • )

19
References SQL99 - II
  • Reference to a tuple of type T
  • REF(T)
  • Reference to tuples in relation R, where R is a
    table whose type is the UDT T
  • REF(T) SCOPE R

20
References SQL99 - II Example
  • CREATE TYPE StarType AS (
  • name CHAR(30),
  • address AddressType,
  • bestMovie REF(MovieType) SCOPE Movie
  • )

21
Commercial ORDBMs - I
  • Object Types
  • Object Views
  • Inheritance
  • Constructors
  • References
  • Language bindings
  • JDBC, SQLJ
  • C Call Interface (OCCI)

22
Commercial ORDBMs - II
  • Sybase
  • DB2
  • UNISQL
  • UNISYS

23
Object Relational Model Summary
  • Extends Relational Model to include
  • Structured types (complex types for attributes,
    including relations as types, type hierarchies)
  • Methods defined for a type
  • Ability of one tuple to refer to another through
    reference type
  • Allows for
  • Higher flexibility
  • More natural modeling
  • Continued robustness and reliability

24
References
A first course in database systems, Jeffrey D.
Ullman, Jennifer Widom, Prentice Hall 2002
Simple Strategies for Complex Data Oracle9i
Object-Relational Technology http//www.oracle.com
/technology/products/oracle9i/pdf/simple_strat_for
_complex_rel2.pdf
DB2's Object-Relational Highlights http//www-106.
ibm.com/developerworks/db2/library/techarticle/zei
denstein/0108zeidenstein.html
Write a Comment
User Comments (0)
About PowerShow.com