Object-Oriented Databases Object Oriented Databases ODMG Standard - - PowerPoint PPT Presentation

object oriented databases object oriented databases
SMART_READER_LITE
LIVE PREVIEW

Object-Oriented Databases Object Oriented Databases ODMG Standard - - PowerPoint PPT Presentation

Object-Oriented Databases Object Oriented Databases ODMG Standard Object Model, Object Definition Language, Object Query Language Programming Language Bindings Outlook October 17, 2008 Michael Grossniklaus Department of


slide-1
SLIDE 1

Object-Oriented Databases Object Oriented Databases

ODMG Standard

  • Object Model, Object Definition Language, Object Query Language
  • Programming Language Bindings
  • Outlook

October 17, 2008 1 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-2
SLIDE 2

Development of OODBMS

Many systems closely related to programming languages

V t O t Obj tSt Obj ti it (C++) Versant, Ontos, ObjectStore, Objectivity (C++) GemStone (Smalltalk)

Early versions had no query language support Early versions had no query language support

ObjectStore had limited selection-based queries

O developed at INRIA (France) with large funding from O2 developed at INRIA (France) with large funding from European research projects

took more of a database approach took more of a database approach intended to be language independent lot of research on query languages q y g g interests also in interface and development tools support

October 17, 2008 2 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-3
SLIDE 3

Standards for Object Data Management

Object Management Group (OMG)

hit t d t l t d l bj t i t d t architectures and tools to develop object-oriented systems distributed object management best known for Unified Modeling Language (UML) best known for Unified Modeling Language (UML)

Object Data Management Group (ODMG)

data management support data management support complementary to OMG ODMG data model based on OMG object model

October 17, 2008 3 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-4
SLIDE 4

Object Data Management Group (ODMG)

ODMG formed very early in development of OODBMS Informal standards body involving all major vendors

initiated in 1991 by Rick Cattell of SunSoft i iti ll ODMG i d fi l f OODBMS d initially ODMG comprised five people from OODBMS vendors

Promote portability and interoperability across products Not developing a standard OODBMS product

products will vary in terms of languages, tools, interfaces, performance etc performance, etc. products may be tailored to application domains, e.g. version management for Computer-Aided Software Engineering (CASE) g p g g ( )

October 17, 2008 4 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-5
SLIDE 5

ODMG Standard

Object Model Object Definition Language (ODL) Object Query Language (OQL) Language bindings

C++ Binding Smalltalk Binding Java Binding

October 17, 2008 5 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-6
SLIDE 6

ODMG Object Model

Based on the OMG object model Basic modelling primitives

  • bject

unique identifier lit l id tifi literal no identifier

Object state defined by the values carried for a set of ti i tt ib t l ti hi properties, i.e. attributes or relationships Object behaviour defined by the set of operations that can be executed Objects and literals are categorised by their type which defines common properties and common behaviour

October 17, 2008 6 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-7
SLIDE 7

Types

Specification

ti i tt ib t d l ti hi properties, i.e. attributes and relationships

  • perations

exceptions exceptions

Implementation

language binding language binding a specification can have more than one implementation

October 17, 2008 7 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-8
SLIDE 8

Type Specifications

Interface

d fi l b t t b h i defines only abstract behaviour interface Employee {...};

Class Class

defines both abstract behaviour and abstract state class Person { }; class Person {...};

Literal

defines abstract state defines abstract state struct Complex { float real; float imaginary; };

October 17, 2008 8 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-9
SLIDE 9

Type Implementation

Representation

d t t t data structure derived from type's abstract state by the language binding

Methods Methods

procedure bodies derived from type's abstract behaviour by the language binding derived from type s abstract behaviour by the language binding also private methods with no counterpart in specification

October 17, 2008 9 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-10
SLIDE 10

Subtyping and Inheritance

Two types of inheritance relationships IS-A relationship

inheritance of behaviour lti l i h it l di di ll d multiple inheritance, name overloading disallowed interface Professor : Employee {...};

EXTENDS relationship EXTENDS relationship

inheritance of state and behaviour single inheritance single inheritance class EmplPers extends Person : Employee {...};

October 17, 2008 10 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-11
SLIDE 11

Extents

Extent of a type is the set of all active instances

assume class P assume class Person extent of class Person would be the current set of all person objects in the data management system g y

Extents can be maintained automatically

October 17, 2008 11 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-12
SLIDE 12

Collections

Supports both collection objects and collection literals

t d d d li t set unordered, no duplicates bag unordered, duplicates list

  • rdered elements can be inserted

list

  • rdered, elements can be inserted

array

  • rdered, elements can be replaced

dictionary maps keys to values

Collection objects

Set<t>, Bag<t>, List<t>, Array<t>, Dictionary<t,v>

Collection literals

set<t>, bag<t>, list<t>, array<t>, dictionary<t,v> g y y

October 17, 2008 12 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-13
SLIDE 13

Collections

Subset containment relation defined only over sets Operations union, intersection and difference defined only

  • ver sets and bags

No constraints over collections

October 17, 2008 13 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-14
SLIDE 14

Collections

interface Collection : Object { exception InvalidCollectionType{}; p yp {} exception ElementNotFound{ Object element; }; boolean is_empty(); ... boolean contains_element(in Object element); void insert_element(in Object element); void removes_element(in Object element) raise (ElementNotFound); ... Iterator create_iterator(in boolean stable); ... boolean query(in String OQL_predicate, inout Collection result); }; }

October 17, 2008 14 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-15
SLIDE 15

Sets

class Set : Collection { attribute set<t> value; Set create_union(in Set other_set); Set create_intersection(in Set other_set); Set create difference(in Set other set) Set create_difference(in Set other_set); boolean is_subset_of(in Set other_set); boolean is_proper_subset_of(in Set other_set); ... };

October 17, 2008 15 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-16
SLIDE 16

Bags

class Bag : Collection { attribute bag<t> value ; g unsigned long occurrences_of(in Object element) ; Bag create_union(in Bag other_bag) ; Bag create intersection(in Bag other bag) Bag create_intersection(in Bag other_bag) ; Bag create_difference(in Bag other_bag) ; } ;

October 17, 2008 16 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-17
SLIDE 17

Object Definition Language (ODL)

Specification language to define object type interfaces Should support all semantic constructs of object model Should be programming language independent Compatible to OMG Interface Definition Language (IDL) Should be extensible and practical Should be extensible and practical

October 17, 2008 17 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-18
SLIDE 18

ODL Example

class Article extends Publication ( extent Articles ) { exception IllegalPageNumber{ unsigned short pageNumber; }; attribute unsigned short beginPage; attribute unsigned short endPage; unsigned short getBeginPage(); void setBeginPage(in unsigned short beginPage) void setBeginPage(in unsigned short beginPage) raises (IllegalPageNumber); unsigned short getEndPage(); void setEndPage(in unsigned short endPage) raises (IllegalPageNumber); }; }

October 17, 2008 18 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-19
SLIDE 19

Relationships

class Author { ... relationship set<Publication> authors inverse Publication::authoredBy; ... } class Publication { ... relationship list<Author> authoredBy relationship list<Author> authoredBy inverse Author::authors; ... }

t i t i f ti l i t it system maintains referential integrity

October 17, 2008 19 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-20
SLIDE 20

Persistence

Persistence by reachability Database gives access to global names

explicitly named root objects t d fi d i h types defined in schema named extents of types

October 17, 2008 20 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-21
SLIDE 21

Other Concepts Supported

Database operations Locking and concurrency control Transactions Access to metadata Structured literals and objects for Structured literals and objects for

dates times timestamps intervals ...

October 17, 2008 21 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-22
SLIDE 22

Object Query Language (OQL)

Based on ODMG Object Model Based on SQL-92 Not computationally complete

rather simple to use query language

No explicit update operators

but can invoke update operations on objects

Path expressions to navigate complex objects

person.spouse.address.street.name

October 17, 2008 22 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-23
SLIDE 23

Example OQL Query Example OQL Query

Find the titles of all publications by "Moira C. Norrie" with p y more than one author that were published after 1995

select p.title from Authors a, a.authors p where a.name = "Moira C. Norrie" and p.year > 1995 p y and count(p.authoredBy) >= 2

October 17, 2008 23 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-24
SLIDE 24

Collection Expressions

Universal and existential quantification

f ll i St d t t d tId > 0 for all x in Students : x.studentId > 0

Aggregate operators Group-by operator Order-by operator Union, intersection and difference (only sets and bags) Conversion Conversion Flattening a collection of collections Special operations for lists Special operations for lists

October 17, 2008 24 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-25
SLIDE 25

"ODMG 4.0"

ODMG was dissolved in 2001 OMG obtained rights to ODMG 3.0 in 2003 OMG Object Database Technology Working Group (ODBTWG) was founded in 2005 in response to renewed interest in object-oriented databases First white paper proposes object calculus based on abstract store model and stack-based queries

October 17, 2008 25 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-26
SLIDE 26

Literature

  • R. G. Cattell, Douglas K. Barry, Mark Berler, Jeff Eastman,

D id J d C i R ll Ol f S h d T t David Jordan, Craig Russell, Olaf Schadow, Torsten Stanienda, Fernando Velez (Editors): The Object Data Standard: ODMG 3 0 Morgan Kaufmann 2000 Standard: ODMG 3.0, Morgan Kaufmann 2000 OMG Object Database Technology Working Group: Next- G ti Obj t D t b St d i ti Whit Generation Object Database Standarization, White Paper, September 2007

October 17, 2008 26 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch

slide-27
SLIDE 27

Next Week Next Week

ObjectStore and Objectivity/DB

  • Application Development
  • Model of Persistence
  • Advanced Features

October 17, 2008 27 Michael Grossniklaus – Department of Computer Science – grossniklaus@inf.ethz.ch