Object Databases - PowerPoint PPT Presentation

1 / 41
About This Presentation
Title:

Object Databases

Description:

attribute string name; attribute string address; attribute date dob; ... from Persons x. where x.name = 'Pat'; Return literal of type set struct ... – PowerPoint PPT presentation

Number of Views:77
Avg rating:3.0/5.0
Slides: 42
Provided by: davidala3
Category:

less

Transcript and Presenter's Notes

Title: Object Databases


1
Object Databases
  • February 2007

2
Contents
  • Data Model History (Revisited)
  • Semantic Data Models
  • Functional Data Model and DAPLEX
  • Object Oriented Databases
  • Origins, Strategies and Issues
  • Object-Oriented Database System Manifesto
  • Object Database Standard
  • JDO
  • P/FDM

3
Introduction
  • Relational Model is the most popular data model
    used in industry
  • But it has certain failings due mainly to its
    limited modelling capabilities
  • Many models appeared which attempted to
    represent the real world more closely
  • These are known as semantic data models
  • Can be seen as the basis of object data models
    which we discuss later in this session

4
Semantic Data Models
  • First semantic model was the E-R model by Chen
    in 1976
  • However, this is not a true data model
  • Why not?
  • Data model structure rules manipulation
  • Now a widely accepted modelling tool for
    relational database design
  • But not a data model

5
Semantic Data Models
  • In 1979, Codd devised RM/T
  • an extended version of the relational model
  • no distinction between entities and relationships
  • varying types of relations (one-to-many and
    subtyping)
  • E-attributes, E-relations, P-relations
  • Supports associations (e.g. many-to-many
    relationships) and subtyping
  • Nested Relational Model
  • Originally proposed by Roth as NF2 (Roth, 1988)
  • Non first-normal form relations
  • Requires two new operations added to relational
    algebra
  • NEST and UNNEST

6
Semantic Data Models
  • Other semantic data models
  • Logical Data Model (Kuper and Vardi, 1985, 1997)
  • Semantic Data Model (Hammer and McLeod, 1981)
  • Semantic Association Model (Su, 1983)
  • Functional Data Model (Kerschberg and Pacheco,
    1976, Shipman, 1981)
  • We will briefly look at Shipmans model

7
The Functional Data Model
  • Originally defined by Kerschberg and Pacheco 1976
  • Most common version devised by Shipman in 1981
  • Defined functional data model with manipulation
    language DAPLEX
  • No original implementation, but used in research
    projects
  • ADAPLEX language based on ADA
  • EFDM by Atkinson et. al. in Glasgow
  • P/FDM by Gray, et. al. in Aberdeen
  • Iris Object-Oriented Database

8
Introduction to DAPLEX
  • DAPLEX is a database language which
    incorporates1
  • A formulation of data in terms of entities
  • A functional representation for both actual and
    virtual (derived) data relationships
  • A rich collection of language constructs for
    expressing entity selection criteria
  • A notion of subtype/supertype relationships among
    entity types

9
Quote!
  • The DAPLEX language is an attempt to provide a
    database system interface which allows the user
    to more directly model the way he thinks about
    the problems he is trying to solve.

10
Object Data Models
  • Object models are attempts to provide models
    which more closely model the real world
  • An extension of semantic models but using more
    common object-oriented concepts
  • Developed to address the increasing complexity of
    database applications, e.g. CAD/CAM
  • DAPLEX could be seen as a query language for
    object databases
  • Due to its navigational querying abilities
  • And its support for complex objects and
    inheritance
  • Object-oriented database system Iris uses form of
    DAPLEX as query language

11
Origins of OO Data Model
  • Traditional Database Systems (e.g. relational)
  • persistence, sharing, transactions, concurrency
    control, recovery control, security, integrity,
    querying
  • Semantic Data Models
  • generalisation, aggregation, navigational
    querying
  • Object-Oriented Programming
  • object identity, encapsulation, inheritance,
    types and classes, methods, complex objects,
    polymorphism, extensibility
  • Special Requirements
  • versioning, schema evolution

12
Persistent Programming Languages
  • Definition
  • a language that provides its users with the
    ability to (transparently) preserve data across
    successive executions of a program, and even
    allows such data to be used by many different
    programs
  • Database Programming Language
  • a language that integrates some ideas from the
    database programming model with traditional
    programming language features

13
Database Programming Languages
  • A significant influence on OODB development
  • PPL independent of any program
  • DBPL incorporates features such as transaction
    management, concurrency control, recovery
  • SQL2 specifies that SQL can be embedded in a host
    language - impedance mismatch
  • PPL research has had a significant influence on
    OODBMS
  • eliminate impedance mismatch and maintain the
    same data representation in primary and secondary
    storage

14
OODBMS Development Strategies
  • Various approaches
  • Extend an existing OO-PL with database
    capabilities
  • Provide extensible OO DBMS libraries
  • Embed OO database language constructs in a
    conventional host language
  • Extend an existing database language with OO
    capabilities
  • We will discuss SQL-3 later in the module
  • Develop a novel data model/data language

15
OODB Issues
  • Transactions
  • transactions on complex objects can be lengthy
  • need to support long duration transactions
  • unit of concurrency and recovery control is
    generally an object
  • normally use locking-based protocols, but
    unacceptable if long duration transaction aborts
    due to a lock conflict

16
OODB Issues (2)
  • Versions
  • many applications may need to access a previous
    state of an object
  • version management is the process of maintaining
    the evolution of objects
  • object version represents an identifiable state
    of an object
  • version history represents the evolution of an
    object

17
OODB Issues (3)
  • Schema Evolution
  • dynamically defining and modifying the database
    schema
  • Changes to schema must not leave it in an
    inconsistent state
  • Typical changes to schema
  • changes to class definition - modifying
    attributes, modifying methods
  • changes to the inheritance hierarchy, such as
    making a class a superset of another, removing a
    class from a list of superclasses, modifying
    superclass order
  • changes to the set of classes, such as creating
    and deleting classes and modifying class names

18
OODB Issues (4)
  • Architecture
  • 3 basic client-server architectures
  • object server
  • page server
  • database server
  • Methods - two approaches to handling methods
  • store the methods in external files
  • store the methods in the database

19
Object Oriented Database System Manifesto (1989)
  • Atkinson devised 13 mandatory features for an
    OODBMS
  • based on two criteria
  • should be an OO system
  • should be a DBMS

20
Object-Oriented Database System Manifesto
  • OO Criteria
  • 1. Complex objects must be supported
  • 2. Object identity must be supported
  • 3. Encapsulation must be supported
  • 4. Types or classes must be supported
  • 5. Types or classes must be able to inherit from
    their ancestors
  • 6. Dynamic binding must be supported
  • 7. The DML must be computationally complete
  • 8. The set of data types must be extensible

21
Object-Oriented Database System Manifesto
  • DBMS Criteria
  • 9. Data persistence must be provided
  • 10. The DBMS must be capable of managing very
    large databases
  • 11. The DBMS must support concurrent users
  • 12. The DBMS must be capable of recovery from
    hardware and software
  • 13. The DBMS must provide a simple way of
    querying data

22
OODB Advantages
  • Enriched modelling capabilities
  • Extensibility
  • Removal of impedance mismatch
  • More expressive query language
  • Support for schema evolution
  • Support for long duration transactions
  • Applicability to advanced database applications
  • improved performance

23
OODB Disadvantages
  • Lack of universal data model
  • Lack of experience
  • Lack of standards
  • Query optimisation compromises encapsulation
  • Locking at object level may impact performance
  • Complexity
  • Lack of support for views
  • Lack of support for security

24
And most importantly
  • What about integrity?

25
Object Database Standard
  • Standard for Object-Oriented Data Model proposed
    by Object Data Management Group
  • ODMG Object model is a superset of OMG object
    model
  • Consists of
  • Object model (OM)
  • Object Definition Language (ODL)
  • Object Interchange Format (OIF)
  • Object Query Language (OQL)
  • Language bindings C, Smalltalk, Java

26
Object Model
  • Basic Constructs
  • object
  • literals
  • both characterised by types
  • objects
  • attributes
  • relationships
  • operations

27
Types
  • Interface Definition
  • defines abstract behaviour of object type
  • e.g. interface Employee..
  • Class
  • defines abstract behaviour and abstract state
  • extended interface with information for ODMS
    schema definition
  • objects are class instances
  • e.g. class Person..
  • Literal
  • abstract state of a literal type
  • e.g. struct Complex float ie, float im

28
Types (cont)
  • Inheritance
  • applied to both interfaces and classes
  • inheritance of behaviour between object types
  • Extend
  • applied to object types only
  • inheritance of state and behaviour
  • Extent
  • set of all instances of a class
  • extension
  • must have an unique key

29
Objects
  • Instances of a class
  • Have an unique object identifier
  • remains for lifetime of object
  • Names
  • equivalent to global variables
  • Lifetime can be
  • transient
  • persistent
  • type and lifetime are independent

30
Objects
  • Collections
  • Set, Bag, List, Array
  • Dictionary - sequenced key-value pairs
  • Structured objects
  • Date, Interval, Time, Timestamp
  • Literals
  • Atomic, Collection, Structured

31
Example ODL Schema
  • class Student
  • (extent students)
  • attribute short id
  • attribute string name
  • attribute string address
  • attribute date dob
  • relationship setltModulegt takes
  • inverse Module takenby
  • short age()

32
Example ODL Schema
  • class Module
  • (extent modules)
  • attribute string title
  • attribute short semester
  • relationship setltStudentgt takenby
  • inverse Student takes
  • class Postgrad extends Student
  • (extent postgrads)
  • attribute string thesis_title

33
Object Interchange Format
  • Used to dump/load current state of ODBMS to/from
    a set of files
  • e.g. Sarah PersonName Sarah,
  • PersonAddressStreet Willow Lane,
  • City Durham,
  • Phone CountryCode 44,
  • AreaCode 191,
  • PersonCode 1234

34
Object Query Language
  • Similar to SQL92
  • extensions complex objects, object identity,
    path expressions, polymorphism, operation
    invocation, late binding
  • e.g. select distinct x.age
  • from Persons x
  • where x.name Pat
  • Return literal of type setltstructgt
  • select distinct struct(a x.age, s x.sex)
  • from Persons x
  • where x.name Pat

35
OQL Examples
  • Path Expressions
  • select c.address
  • from Persons p, p.children c
  • where p.address.street Main Street
  • and count(p.children) gt 2
  • and c.address.city ! p.address.city
  • Methods
  • select max(select c.age from p.children c)
  • from Persons p
  • where p.name Paul

36
OQL Polymorphism Examples
  • Late Binding
  • select p.activities
  • from Persons p
  • Class Indication
  • select ((Student)p).grade
  • from Persons p
  • where course of study in p.activities

37
Java Data Objects
  • ODMG disbanded in 2001
  • ODMG Java Data Binding superceded by JDO
  • JDO
  •   Provides transparent persistence
  •   Scales from embedded to enterprise
  •   Integrates with EJB and J2EE
  •   Is being widely adopted in the database
    industry
  • More information at www.odmg.org

38
P/FDM
  • An implementation of Shipmans functional data
    model and query language DAPLEX
  • Built on top of the Prolog programming language
  • Supports object-oriented extensions
  • e.g. inheritance, methods, complex objects
  • We will be using it as an object-oriented DBMS in
    the module

39
Comparison
  • class Student
  • (extent students)
  • attribute short id
  • attribute string name
  • attribute string address
  • attribute date dob
  • attribute Lecturer tutor
  • relationship setltModulegt takes
  • inverse Module takenby
  • short age()
  • select s.address, t.tutor_name
  • from students s, s.tutor t
  • where s.name Fred
  • declare student -gt entity
  • declare id(student) -gt integer
  • declare name(student) -gt string
  • declare address(student) -gt string
  • declare dob(student) -gt string
  • declare tutor(student) -gt lecturer
  • declare takes(student) -gtgt module
  • define age(student) -gt
  • for each s in student
  • such that name(s) Fred
  • print(address(s), tutor_name(tutor(s)))

40
Summary
  • Object-oriented databases used for niche
    applications in the market place
  • They are an object-oriented extension of semantic
    databases
  • Atkinson et al produced a manifesto to try to
    state what concepts are necessary for an OODBMS
  • ODMG devised a standard but in some ways it was
    too late because most OODBMS had been implemented
    by then

41
References
  • Shipman, The Functional Data Model and the Data
    Language DAPLEX, ACM TODS 6(1) 1981
  • Connolly Begg, chapters 21 and 22
  • Date 7th ed., chapter on Object-Oriented
    databases
  • Atkinson et al, Object-Oriented Database System
    Manifesto, Proc. 1st Intl Conference on DOOD,
    Japan, 1989.
  • Cattell, et. al., The Object Data Standard
    ODMG3.0
Write a Comment
User Comments (0)
About PowerShow.com