Matakuliah Tahun Versi : M0174/OBJECT ORIENTED DATABASE : 2005 : 1/0 Pertemuan 7 The Object Definition Language 1 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : • Mahasiswa dapat Menjelaskan object definition language (C2) • Mahasiswa dapat Menjelaskan hubungan antara ODL dengan bahasa program dan database schema (C2) 2 Outline Materi • • • • • • • What is ODL ? The structure of an ODL Schema Class definition Class header Supertypes and extender classes Type properties Interface definition 3 What is ODL ? • ODL is one of a collection of language which are used together to implement object database system. • The purpose of ODL is to define object types which conform to the object data model 4 What is ODL ? • Relationship between ODL and Other Programming Language Object databse application program written in a programming language such as C++, Java ODL definition of the interface between the applications and the object database Implementation of the object database types written in a programming language such as C++, Java 5 What is ODL ? • Relationship of ODL to an Object Database Schema & Application ODL Object Database Schema Type Declaration and Interface Object Database Application Program Written in an Extended Programming Language Object Database Schema Preprocessor Programming Language Compiler/Linker Object Database Application Object Database Management System Runtime Library 6 What is ODL ? • Two further advantages of the independence of ODL from specific programming language: – First the ability to port object database system from one programming environment to other. – Second the ability to operate many object database system together, even when different language have been used to implement them. 7 What is ODL ? • The ability to define interface to object in a way which is independent of the language that are used to implement or utilize them has a general use in distributed object oriented environment. • This ability makes it possible for many application to share and utilize objects which provide general service. 8 What is ODL ? • The rules for forming statements is ODL, are given using a notation called extended BNF (Backus-Naur Form) in which: – The symbol “ ::= “ can read as ‘is defined as’ – The Part of an ODL statement are described in angular brackets (e.g <type definition>), or as they appear in the statement it self. – Square brackets are used to denote optional parts of an expression. An asterisk after the closing square bracket “]* ” indicates the optional part can occur many time. – A vertical line is used to separate alternative parts of an expression. 9 The structure of an ODL Schema • The purpose of an ODL Schema is to enable application programs and tools to create, access, and manipulate the contents of an object database • Examples 10 Class definition • A class definition defines the behaviour and state of an object type • Examples 11 Class header • Object types are themselves represented as objects and therefore have properties • The properties of an object type include its supertypes, extender class, extent, and keys 12 Supertypes and extender classes • A class may inherit from other object types in two ways : – A class may have zero or one extender class – An object type (a class or interface) may also have zero, one, or more interface which are its supertypes from which it inherits behaviour 13 Type properties • The extent name • The instance properties that are used as keys 14 Interface definition • An interface definition has two main parts – The interface header – The interface body 15 SUMMARY • The ODL is the ddl for object database • The approach contrasts with that of persistent object oriented programming languages 16