The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott,...

20
The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan David Tucker & Andrew Wan Presentation Presenters: Christopher Parrott & Presentation Presenters: Christopher Parrott & Christopher Sinclair Christopher Sinclair

Transcript of The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott,...

Page 1: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

The ODMG Standard 2.0Focusing On The ODMG Object Model

Group Members: Christopher Parrott, Christopher Sinclair, Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew WanDavid Tucker & Andrew Wan

Presentation Presenters: Christopher Parrott & Christopher SinclairPresentation Presenters: Christopher Parrott & Christopher Sinclair

Page 2: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Introduction

• ODMG (Object Data Management Group) formed in ODMG (Object Data Management Group) formed in 1991.1991.

• Independent organisation to standardise Object Independent organisation to standardise Object Oriented Database Management Systems.Oriented Database Management Systems.

• Corporate members includes Corporate members includes Sun, PoetSun, Poet & & Computer Computer Associates.Associates.

• ODMG covers following key areas:ODMG covers following key areas: Object Model (OM)Object Model (OM) Object Definition Language (ODL)Object Definition Language (ODL) Object Query Language (OQL)Object Query Language (OQL) C++, Java & Smalltalk Bindings.C++, Java & Smalltalk Bindings.

Page 3: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

The Object Model

• About ODMG Object ModelAbout ODMG Object Model• Database TypesDatabase Types

Specifications & ImplementationsSpecifications & Implementations• Object type definition consists of two components, they are Object type definition consists of two components, they are

InterfaceInterface & one or more & one or more ImplementationsImplementations..

Interface

Implementation

User

User User

User

visible to the users of the type

not visible to the users of the type

Class

Type SpecificationType Specification

Page 4: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Objects

• Object IdentifiersObject Identifiers• Object LifetimeObject Lifetime• CollectionsCollections• Collection ObjectsCollection Objects• Set ObjectsSet Objects• Bag ObjectsBag Objects• List ObjectsList Objects• Array ObjectsArray Objects• Dictionary ObjectsDictionary Objects

Page 5: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Objects

• Literal Values. Literal Values. ODMG model supports several literal types:ODMG model supports several literal types:

• AtomicAtomic

• CollectionCollection

• StructuredStructured

• Object HierarchyObject Hierarchy

Page 6: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Modelling State

• IntroductionIntroduction Provides description of Provides description of

data structure & relates data structure & relates interfaces to a set of interfaces to a set of object types in a type object types in a type hierarchy.hierarchy.

• Object Type InterfacesObject Type Interfaces Describes how data can Describes how data can

be stored & relations to be stored & relations to other types of data.other types of data.

Employee ExtendsPerson

Employee_numberEmployee_dobEmployee_salary

+getName()+getDOB()+iSalary(aAmount)

Company

Company_NameCompany_AddresstheEmployees

+getName()+printEmployees()+employ(aEmployee)

Work_For

-Class Operations -Class Operations

-Class Properties -Class Properties

Person

Person_namePerson_bloodtype

+returnName()+getBloodtype()

-Class Operations

-Class Properties

Type diagram of object type definitionType diagram of object type definition

Page 7: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Modelling State

• Attributes & Attributes & RelationshipsRelationships One To OneOne To One One To ManyOne To Many Many To ManyMany To Many

• NamesNames

Employee Company

WorksFor

Company Employee

theEmployees

N

Departments Manager

theManagers

N theDepartments

N

One To One Relationship

One To Many Relationship

Many To Many Relationship

Employee

Name = jeffDept_employ=It_support

Department

Name = It_supportEmployees = jeff, bob….

Employee

jeff bob

It_support

Name = bobDept_employ=It_support

Examples Of RelationshipsExamples Of Relationships

Representation of how objectRepresentation of how object names can be used names can be used to represent entities to represent entities

with shared componentswith shared components

Page 8: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Modelling State

• MetadataMetadata Descriptive information about persistent objects that defines Descriptive information about persistent objects that defines

the ‘schema’.the ‘schema’. Used by ODBMS to define structure .Used by ODBMS to define structure . Metadata is stored in an ‘ODL Schema Repository’.Metadata is stored in an ‘ODL Schema Repository’. Considered important for object oriented database systems.Considered important for object oriented database systems.

• Example of a operation that returns the class of an object.Example of a operation that returns the class of an object.

• Above operation will store description of employee class.Above operation will store description of employee class.

• EmployeeMetaDataEmployeeMetaData is used to print the employee’s name as is used to print the employee’s name as the the getNamegetName function is part of the employee class. function is part of the employee class.

EmployeeMetaData = William->getClass( ) EmployeeMetaData = William->getClass( )

EmployeeName = EmployeeMetaData ->getName( )EmployeeName = EmployeeMetaData ->getName( )

Page 9: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Modelling Behaviour

• IntroductionIntroduction Object’s behaviour is Object’s behaviour is

defined by its set of defined by its set of operations.operations.

Operation has its specific Operation has its specific type defined.type defined.

• OperationsOperations Described as a piece of Described as a piece of

code fragment.code fragment. Manipulates the Manipulates the

properties and data of properties and data of object.object.

• ExceptionsExceptions

Employee

Void+salaryIncrease(aAmount)

-Operation salaryIncrease defined in Employeeclass increases the salary property with thespecified amount entered as a parameter. Theoperation does that return anything.

Company

Void+employ(aEmployee)

Employee

theEmployees

-Operation employ defined in Company classsets a employee instance into theEmployees.Thus adding a employee to the company. Theemployee instance is passed as a parameter tothe operation. The operation does not returnanything.

Employee

Date+dateOfBirth()

-Operation dateOfBirth returns the employee’sdate of birth after calculation. The operationaccepts no parameters and returns a date type.

Page 10: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Concurrency & Transaction Control

• ODMG view on locking & Concurrency ControlODMG view on locking & Concurrency Control• Locking ControlLocking Control• Types of locksTypes of locks

Read LocksRead Locks Write LocksWrite Locks Upgrade LocksUpgrade Locks

• Prevention against form of deadlock when two processes both Prevention against form of deadlock when two processes both obtain read locks on object then attempt to obtain a write lock on obtain read locks on object then attempt to obtain a write lock on the same object.the same object.

• Deadlock avoided initially by obtaining upgrade lock instead of Deadlock avoided initially by obtaining upgrade lock instead of read locks for all objects user intends to modify.read locks for all objects user intends to modify.

• Avoids potential conflicts when write lock is later obtained. Avoids potential conflicts when write lock is later obtained.

Page 11: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Concurrency & Transaction Control

• Lock DurationLock Duration• Concurrency ControlConcurrency Control• TransactionsTransactions

All programs that implements persistent objects must be All programs that implements persistent objects must be organised into transactions.organised into transactions.

Once transaction commits, ODBMS guarantees changes Once transaction commits, ODBMS guarantees changes made by transaction are never lost.made by transaction are never lost.

ODMG data supports traditional ACID (Atomicity, ODMG data supports traditional ACID (Atomicity, Consistency, Integrity & Durability).Consistency, Integrity & Durability).

Transactions are started with begin command, similar to new Transactions are started with begin command, similar to new command when creating objects.command when creating objects.

Transactions can be initiated & started explicitly.Transactions can be initiated & started explicitly.

Page 12: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Concurrency & Transaction Control

• Event ManagementEvent Management• Managing Logical DatabasesManaging Logical Databases

ODBMS can manage one or more logical databases. All of ODBMS can manage one or more logical databases. All of these logical databases are instances of type these logical databases are instances of type databasedatabase..

Instances of type database created using Instances of type database created using DatabaseFactoryDatabaseFactory interface.interface.

Query identifies part of data explicitly by naming or by Query identifies part of data explicitly by naming or by specifying conditions. specifying conditions.

Database type also supports operations designed to aid the Database type also supports operations designed to aid the administration of the whole system. Such operations include:administration of the whole system. Such operations include:

• DeleteDelete

• MoveMove

• CopyCopy

• BackupBackup

• Restore all of which to keep database in ‘Good Order’Restore all of which to keep database in ‘Good Order’

Page 13: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Object Specification Languages

• About Object Specification LanguagesAbout Object Specification Languages Used in representation of ODMG compliant object database Used in representation of ODMG compliant object database

management systems.management systems. Composed of independent languages used in the definition of Composed of independent languages used in the definition of

schemas.schemas. Objectives of these independent languages are:Objectives of these independent languages are:

• Provide portability of databases across ODMG compliant Provide portability of databases across ODMG compliant implementations.implementations.

• Interoperability of OODMS from different & multiple vendors.Interoperability of OODMS from different & multiple vendors.

One of main OSL languages is ODL (Object Definition One of main OSL languages is ODL (Object Definition Language), there is also OIF (Object Interchange Format).Language), there is also OIF (Object Interchange Format).

Page 14: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Object Query Language

• About Object Query LanguagesAbout Object Query Languages Developed by ODMG for use with ODMG databases.Developed by ODMG for use with ODMG databases. Language Provides mechanism by which user can request a Language Provides mechanism by which user can request a

subset of data from a database, such requests referred to as subset of data from a database, such requests referred to as ad hoc. ad hoc.

Object Query Language (OQL) is part of the SQL family of Object Query Language (OQL) is part of the SQL family of languages. languages.

Contains query syntax from SQL such as:Contains query syntax from SQL such as:• ‘‘Select… From… Where…’Select… From… Where…’

Page 15: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Bindings

• The idea of BindingsThe idea of Bindings Binding creates association between run-time system of Binding creates association between run-time system of

programming language & the persistent store of database programming language & the persistent store of database system.system.

Usually takes the form of library functions which access the Usually takes the form of library functions which access the DBMS functionality.DBMS functionality.

ODMG standard implements bindings based on one ODMG standard implements bindings based on one fundamental principle:fundamental principle:

• ““The programmer should perceive the binding as a single The programmer should perceive the binding as a single language for expressing both database & programming language for expressing both database & programming operations, not two separate languages with arbitrary boundaries operations, not two separate languages with arbitrary boundaries between them”. ODMG 2.0, 1997between them”. ODMG 2.0, 1997

Page 16: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Literature Review

• Alagic, Suad Alagic, Suad 1996/19971996/1997

The ODMG Object Model: Does it Make Sense?The ODMG Object Model: Does it Make Sense?

OOPSLA (OOPSLA (ACM Conference on Object-Oriented Programming, ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications)Systems, Languages, and Applications) USA USA

• Chaudhri, Akmal B.Chaudhri, Akmal B.19971997

Experiences Using Object Data Management In the Real Experiences Using Object Data Management In the Real WorldWorld

OOPSLA 1997 WorkshopOOPSLA 1997 Workshop

Page 17: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

The New ODMG 3.0 Standard

• What's new in the ODMG 3.0 StandardWhat's new in the ODMG 3.0 Standard

• Object ModelObject Model

Page 18: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Conclusions

• The ODMG standard & Its Real World Application.The ODMG standard & Its Real World Application.• Conclusions & Criticisms of the ODMG Object Model. Conclusions & Criticisms of the ODMG Object Model.

ODMG model requires careful examination before it is ODMG model requires careful examination before it is accepted.accepted.

Not yet industry standard.Not yet industry standard. Type checking system in ODMG model is not perfect.Type checking system in ODMG model is not perfect.

• Dynamic type checking used, but will always be in situations Dynamic type checking used, but will always be in situations where it fails. where it fails.

• Means that run-time checks will have to be used.Means that run-time checks will have to be used.

• Reduces Efficiency & Reliability of overall system.Reduces Efficiency & Reliability of overall system.

Parametric types not supported in current issue of the object Parametric types not supported in current issue of the object model.model.

• Except in C++ BindingsExcept in C++ Bindings

Page 19: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

Conclusions

Lack of “self” type.Lack of “self” type. Complaints towards ODMG model relate to the fact that it is Complaints towards ODMG model relate to the fact that it is

not a formal, mathematical model.not a formal, mathematical model. ODGM model does have problems, but the model itself is still ODGM model does have problems, but the model itself is still

work in progress.work in progress. Most likely to be adjusted to solve some of the major Most likely to be adjusted to solve some of the major

weaknesses in current version. weaknesses in current version.

Page 20: The ODMG Standard 2.0 Focusing On The ODMG Object Model Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew Wan Presentation.

The ODMG Standard 2.0Focusing On The ODMG Object Model

Group Members: Christopher Parrott, Christopher Sinclair, Group Members: Christopher Parrott, Christopher Sinclair, David Tucker & Andrew WanDavid Tucker & Andrew Wan

Presentation Presented By: Christopher Parrott & Christopher SinclairPresentation Presented By: Christopher Parrott & Christopher Sinclair

• Any Questions?Any Questions?

End Of Presentation