1 pertemuan 7 the object definition language matakuliah: m0174/object oriented database tahun: 2005...
Post on 21-Dec-2015
231 views
TRANSCRIPT
1
Pertemuan 7The Object Definition Language
Matakuliah : M0174/OBJECT ORIENTED DATABASE
Tahun : 2005
Versi : 1/0
2
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)
3
Outline Materi
• What is ODL ?
• The structure of an ODL Schema
• Class definition
• Class header
• Supertypes and extender classes
• Type properties
• Interface definition
4
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
5
What is ODL ?
• Relationship between ODL and Other Programming Language
Object databse application program written in a programminglanguage such as C++, Java
ODL definition of the interface between the applications and theobject database
Implementation of the object database types written in aprogramming language such as C++, Java
6
What is ODL ?
• Relationship of ODL to an Object Database Schema & Application
ODL Object DatabaseSchema Type
Declaration andInterface
Object DatabaseSchema Preprocessor
Object Database
Object DatabaseApplication Program
Written in an ExtendedProgramming Language
Programming LanguageCompiler/Linker
Application
Object DatabaseManagement System
Runtime Library
7
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.
8
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.
9
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.
10
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
11
Class definition
• A class definition defines the behaviour and state of an object type
• Examples
12
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
13
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
15
Interface definition
• An interface definition has two main parts – The interface header– The interface body