• Nenhum resultado encontrado

Modelhip ModelndardRelational Data Entity-RelationsSQL:1999XMLCODASYL StanODMG 1.0OM Data ModelSQL-86ODMG 3.0SQLRESXCOOSOS

N/A
N/A
Protected

Academic year: 2022

Share "Modelhip ModelndardRelational Data Entity-RelationsSQL:1999XMLCODASYL StanODMG 1.0OM Data ModelSQL-86ODMG 3.0SQLRESXCOOSOS"

Copied!
35
0
0

Texto

(1)

Obj t O i t d D t b

Object-Oriented Databases

Introduction

Course Overview

Evolution and History of Database Management Systems

Requirements of Object-Oriented Database Management Systems

(2)

Organisation g

ƒ Michael Grossniklaus IFW D 46.2

+41 44 632 72 73

grossniklaus@inf.ethz.ch

ƒ Alexandre de Spindler IFW D 47 1

IFW D 47.1

+41 44 632 74 16

d i dl @i f th h

despindler@inf.ethz.ch

(3)

Exercises

ƒ Course will be accompanied by exercises

ƒ Work with technologies covered in the course

ƒ Tutorial sessions every week Tutorial sessions every week

ƒ starting on October 5th, 2007

ƒ IFW A 32.1, 11-12IFW A 32.1, 11 12

ƒ Alexandre de Spindler

ƒ Optional, but strongly recommended!

(4)

Exam

ƒ Session Examination

ƒ January 21st, 2008 – February 15th, 2008

ƒ Exceptions can be arranged for exchange students

ƒ Oral exam in English

ƒ Duration of 15 minutes

ƒ 5 ECTS

(5)

Course Overview

I. Basics of Object-Oriented Databases

1. Introduction

2. Object Persistence

3. db4o

II. Advanced Concepts of Object-Oriented Databases

4. Standards and Commercial Systems

5. Storage and Indexing

6. Version Models

III. Semantic Object Data Management

7. OM Data Model and OM Data Model Language

8. Design and Implementation of OMS Avon

9 C t t A D t M t

9. Context-Aware Data Management

(6)

Database Design g

Conceptual Design

Implementation Design

Physical Design

(7)

Database Management Systems g y

Conceptual modelling

Client Interface Layer E/R

SQL, JDBC, ODBC Conceptual modelling

Data access and representation

Data Model Layer Relational Model Data semantics

Operation semantics

Storage Layer RDBMS Persistence

ACID

Distribution

(8)

Evolution and History y

Model hip Model

ndard

Relational Data Entity-Relations SQL:1999 XML

CODASYL Stan ODMG 1.0 OM Data Model

SQL-86 ODMG 3.0

SQL

Hierarchical Network

R E S XC O OS OS

Network

Object-Oriented Relational

Object Oriented

Semi-Structured Object-Relational

XML

1960 1970 1980 1990 2000

1960 1970 1980 1990 2000

(9)

Hierarchical Databases

ƒ Data organised in a tree

ƒ a parent can have many children

ƒ a child can have only one parent

ƒ Records described by entity types

ƒ 1:N (one-to-many) relationships ( y) p

ƒ Query by path navigation

ƒ Examples

ƒ Examples

ƒ File system

ƒ LDAP

ƒ LDAP

ƒ Windows Registry and Active Directory

ƒ XML documents and XQuerydocu e s a d Que y

(10)

Network Databases

ƒ Data organised in graph (lattice)

ƒ a parent can have many children

ƒ a child can have many parents

ƒ Bachmann diagrams

ƒ Record types define properties yp p p

ƒ Set types defined relationships

ƒ parent-child (double) linked list

ƒ parent child, (double) linked list, …

ƒ Query by graph navigation

ƒ Examples

ƒ Examples

ƒ CODASYL

(11)

Relational Databases

ƒ Data organised as tuples in relations

ƒ Link between data tuples

ƒ primary and foreign keysp y g y

ƒ Relational algebra

ƒ project, select, joinproject, select, join

ƒ Relational normal forms

ƒ Declarative language

ƒ Declarative language

ƒ data definition, consistency, manipulation and querying

ƒ Examples

ƒ Examples

ƒ Oracle 11g, Microsoft SQL Server, IBM DB2

ƒ PostgreSQL MySQL

ƒ PostgreSQL, MySQL

(12)

Relational Databases

ƒ Relational model is very simple

ƒ only basic concepts → references need to be simulated

ƒ restricted type system → no user-defined types

ƒ Lack of semantic modelling

ƒ complex data, versioning, roles

ƒ Little support for data and schema evolution

ƒ Object-relational impedance mismatch Object relational impedance mismatch

(13)

Object-Relational Impedance Mismatch j p

ƒ Object-oriented application development and relational j pp p data management results in clash of two incompatible models

models

ƒ Code to map between models is considerable overhead, costly and hard to maintain

costly and hard to maintain

(14)

Object-Oriented Databases j

ƒ Data represented as objects

ƒ object identity

ƒ attributes and methods

ƒ references, relationships, associations

ƒ Extensible type hierarchy

ƒ user-defined types, abstract data types

ƒ single or multiple inheritance

ƒ overloading, overriding, late binding

ƒ Declarative language for ad hoc purposes

ƒ Binding for object-oriented programming language

(15)

Object-Relational Databases j

ƒ Relational model extended

ƒ nested relations

ƒ references

ƒ sets

ƒ row types, abstract types f ti

ƒ functions

ƒ Declarative language extended

ƒ computationally complete

ƒ Fundamental impedance mismatch remains

ƒ Commingling of models

(16)

Object-Relational Databases j

create type AddressType (

t t h (10)

street varchar(10), city varchar(10) )

create row type PublicationType ( create row type PublicationType (

title varchar(50) )

create row type BookType ( create row type BookType (

isbn varchar(10) ) under PublicationType

create row type AuthorType ( create row type AuthorType (

name varchar(25),

books setof(BookType), address AddressType

)

create table Book of type BookType

create table Author of type AuthorType

(17)

Emerging and Future Databases g g

ƒ XML Databases

Course 251-0317-00L XML and Databases

P f D D ld K D P t Fi h

Prof. Dr. Donald Kossmann, Dr. Peter Fischer Autumn Semester, Wed 13-15

ƒ Mobile and Personal Databases

Course 251-0373-00L

Mobile and Personal Information Systems Prof Dr Moira C Norrie

Prof. Dr. Moira C. Norrie

Autumn Semester, Thu 9-11

(18)

Object-Oriented Databases j

Object-Oriented Systems

Database Systems

ODB

Systems Systems

OO

ƒ Avoid object-relational impedance mismatch

ƒ Provide a uniform data model

ƒ Combine features and properties of Combine features and properties of

ƒ object-oriented systems and languages

ƒ database management systemsdatabase management systems

(19)

Defining Object-Oriented Databases g j

ƒ Diverse focus of object-oriented database systems

ƒ making object-oriented programming languages persistent

ƒ managing and storing object data

ƒ Many attempts to define object-oriented databases

ƒ The object-oriented database manifesto j

ƒ 13 mandatory features

ƒ 5 optional characteristics

ƒ 4 open choices

ƒ Manifesto aftermath

ƒ several refutations from the relational camp

ƒ several important properties not addressed

(20)

The Object-Oriented Database Manifesto j

1.

Complex objects

2.

Object identity

3.

Encapsulation

4

T d Cl

Object oriented

4.

Types and Classes

5.

Type and Class Hierarchies

6

Overriding overloading and late binding

Object-oriented systems

6.

Overriding, overloading and late binding

7.

Computational completeness

8.

Extensibilityy

9.

Persistence

10.

Efficiency

Database

11.

Concurrency

12.

Reliability

13

D l ti l

Database management systems

13.

Declarative query language

(21)

Objects j

ƒ Complex objects

ƒ complex object formed from simpler ones by constructors

ƒ record, set, bag, list and array complex object constructors

ƒ constructor orthogonality

ƒ Object identity and equality

ƒ every object has unique and immutable object identifier (OID)

ƒ sharing of objects through references

ƒ two objects are identical if they have the same OID

ƒ two objects are equal if they have the same state shallow and deep equality

ƒ shallow and deep equality

(22)

Objects j

ƒ Encapsulation

ƒ object consists of interface and implementation

ƒ interface defines signatures of public methods

ƒ implementation includes object data and methods

ƒ object state is only modified through public methods

bj t d t t t b d f d l ti i

ƒ object data structure may be exposed for declarative queries

record t pe record type

set type public

interface

set type

(23)

Types and Classes yp

ƒ Data types

ƒ definition of object properties

ƒ static part describes object structure

ƒ dynamic part describes object behaviour

ƒ separation of interface and implementation

d t h k t f t il ti

ƒ used to check correctness of programs at compile time

ƒ Object Classes

ƒ container for objects of the same type

ƒ objects can be added and removed

used to create and manipulate objects at run time

ƒ used to create and manipulate objects at run time

(24)

Types and Classes yp

Class has Type

describes contains

Object has Value

(25)

Generalisation Hierarchies

ƒ Advantages

+getName()Publication

ƒ powerful modelling tool

ƒ guarantee semantic complexity

+getName() +getAuthors()

A ti l B k

ƒ reuse of specification and implementation

ƒ Inheritance

+getPages() +getJournal()

Article

getISBN() Book

ƒ objects of subclass belong automatically to superclass

ƒ attributes and methods are inherited from superclass getConference() Proceeding

ƒ subclass can introduce new attributes and methods

ƒ Migration between classes

ƒ move objects between hierarchy levels

ƒ object specialisation (↓) and generalisation (↑)

l i t l b

ƒ class instance versus class member

(26)

Generalisation Hierarchies

ƒ Substitution inheritance

ƒ subtype has more operations than supertype

ƒ subtype can be substituted where supertype is expected

ƒ based on behaviour rather than values

ƒ Inclusion inheritance

ƒ every object of subtype is also object of supertype

ƒ based on structure rather than operations

ƒ Constraint inheritance

ƒ special case of inclusion inheritance

ƒ subtype is expressed by constraint on supertype

ƒ Specialisation inheritance

ƒ subtype objects contain more specific information

(27)

Overriding, Overloading and Late Binding g, g g

ƒ Method overriding

«interface»

Shape

ƒ method is redefined in subtype

ƒ guarantees specialisation of methods

+draw(Graphics g)

Rectangle

ƒ preserves uniform method interface

ƒ Method overloading

+draw(Graphics g) Rectangle

ƒ effect caused by method overriding

ƒ various version of a method can exist in parallel +draw(Graphics g) FilledRectangle

ƒ Late Binding

ƒ appropriate version of overloaded method selected at run time

ƒ also known as virtual method dispatching

(28)

Computational Completeness and Extensibility p p y

ƒ Computational completeness

ƒ requirement for the method implementation language

ƒ any computable function can be expressed

ƒ can be realised through connection with existing language

ƒ Extensibility

ƒ database has a set of predefined types

ƒ developers can define new types according to requirements

ƒ no usage distinction between system and user types

(29)

Durability and Efficiency y y

ƒ Persistence

ƒ data has to survive the program execution

ƒ orthogonal persistence

ƒ implicit persistence

ƒ Secondary storage management

ƒ index management

ƒ data clustering

ƒ data buffering

ƒ access path selection query optimisation

ƒ query optimisation

(30)

Concurrency Control and Recovery y y

ƒ Concurrency

ƒ management of multiple users concurrently interacting

ƒ atomicity, consistency, isolation and durability

ƒ serialisability of operations

ƒ Reliability

ƒ resiliency to user, software and hardware failures

ƒ transactions can be committed or aborted

ƒ restore previous coherent state of data

ƒ redoing and undoing of transactions logging of operations

ƒ logging of operations

(31)

Declarative Query Language Q y g g

ƒ High-level language

ƒ express non-trivial queries concisely

ƒ text-based or graphical interface

ƒ declarative

ƒ Efficient execution

ƒ possibility for query optimisation

ƒ Application independent

ƒ work on any possible database

ƒ no need for additional methods on user-defined types

(32)

Optional Characteristics and Open Choices p p

ƒ Optional characteristics

ƒ multiple inheritance

ƒ type checking and inference

ƒ distribution

ƒ design transactions, long transactions, nested transactions i

ƒ versions

ƒ Open choices

ƒ programming paradigm

ƒ representation system type system

ƒ type system

ƒ uniformity

(33)

Beyond the Manifesto y

ƒ Database administration utilities

ƒ View definition and derived data

ƒ Object Roles Object Roles

ƒ objects have roles in addition to types

ƒ roles can be gained and lost dynamicallyroles can be gained and lost dynamically

ƒ Database Evolution

ƒ schema and data has to evolve gracefully over time

ƒ schema and data has to evolve gracefully over time

ƒ Constraints

ƒ integrity semantic and evolution constraints

ƒ integrity, semantic and evolution constraints

ƒ definition, management and enforcement of constraints

(34)

Literature

ƒ M. Atkinson, F. Bancilhon, D. DeWitt, K. Dittrich, D.

Maier, and S. Zdonik: The Object-Oriented Database System Manifesto, In: Building an Object-Oriented y , g j

Database System, Morgan Kaufmann 1992

ƒ M Stonebraker L A Rowe B Lindsay J Gray M M. Stonebraker, L. A. Rowe, B. Lindsay, J. Gray, M.

Carey, M. Brodie, P. Bernstein, and D. Beech: Third- Generation Database System Manifesto In: ACM Generation Database System Manifesto, In: ACM SIGMOD RECORD, 19(3), 1990

H D d C J D t Th Thi d M if t I

ƒ H. Darwen and C. J. Date: The Third Manifesto, In:

ACM SIGMOD RECORD, 24(1), 1995

(35)

N t W k Next Week

Object Persistence

Serialisation

Object-Relational Mappings and Frameworks

Persistent Programming Languages

Referências

Documentos relacionados

A proposta trazida por meio do tema objeto deste estudo, qual seja, a implantação de corredores ecológicos na Mata Atlântica Brasileira como limite ao direito

O procedimento passou por estimar uma regressão em que, com base na amostra de 2001 a 2009, fosse possível obter uma previsão para 2010, que mais tarde seria comparada com o

Em 2004 3 , também em Luziânia, ocorre a II Conferência, que respalda e amplia a discussão de 1998 sobre as políticas públicas de educação para o campo brasileiro em oposição

Avaliar o estoque e a taxa de sequestro de carbono no solo na camada de 0 - 0,60 m em curto prazo (4 anos), na sucessão de milho no verão e plantas de cobertura de inverno, em

O objetivo deste estudo foi identificar as abordagens dadas aos estudos sobre qualidade de vida das pessoas com deficiência (PCDs) no âmbito dos trabalhos brasileiros

(Vereador do Pelouro da Habitação) No caso de efectivamente vir a existir construção destinada a habitação social no concelho, que na opinião do Vereador do Pelouro da

Neste capítulo — aliás importantíssimo — de diagnose la- boratorial, há dois problemas analíticos absolutamente distin- tos: um, em que se procura conhecer, apenas, as variações

Effect of different processing methods on the functional properties, pasting characteristics and hydrogen cyanide content of high quality cassava flour