download

Matakuliah
Tahun
Versi
: M0174/OBJECT ORIENTED DATABASE
: 2005
: 1/0
Pertemuan 18
Building Object Database Application
(Lanjutan bagian 1)
1
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• Mahasiswa dapat Menjelaskan ikatan
antara programming language dengan
object database (C2)
• Mahasiswa dapat Menjelaskan pembuatan
object database application (C2)
2
Outline Materi
•
•
•
•
•
•
•
•
•
•
•
C++ ODL
Object type
Object
Subtype/supertype Relationship
Extent
Keys
Object names
Object characteristics
Attribute
Relationship
Operations
3
C++ ODL
• Both C++ and object data model are
object oriented and therefore have
underlying object model.
• This simplified the process of defining a
binding between them, since all object
models are base upon a common set of
core principles.
4
C++ ODL
• The task of defining a seamless binding is
also made easier by strong syntactical
similarities between declaration in C++
and the object data model ODL.
5
C++ ODL
• C++ ODL is the extension to C++ for
declaring persistence object types, and
thus implements the binding between C++
and the structural part of the object data
model.
• Object Types
C++ ODL/OML therefore maps each object
data model object type to a C++ class. A C++
Program not only defines the interfaces to
classes but also defines their implementation
6
C++ ODL
• Objects
Each object data model object map into C++
object. C++ doesn’t support persistent
objects. Objects created within a C++
program are destroy when program
terminates.
C++ ODL/OML therefore introduces an
additional mechanism for creating and
referring to objects in the object database.
7
C++ ODL
• Object Characteristics
Each object data model object characteristic
maps into a C++ member, attributes and
relationships map into data members and
operations map into member functions.
8
Object type
• What is object type ?
C++
Class
Object Data Model
Object Type
9
Object
• What is object ?
C++
Object
Object Data Model
Object Type
10
Subtype/supertype Relationship
• Subtype/supertype relationships of the
object data model are directly
implemented in C++ by the
subclass/superclass relationship, and with
a syntax which is almost identical to that in
the ODL
11
Extent
• Definition
• Example
12
Keys
• Definition
• Example
13
Object names
• Definition
• Example
14
Object characteristics
• Definition
• Example
C++
Class Member
Object Data Model
Object Characteristic
15
Attribute
• Definition
• Example
C++
Data Member
Object Data Model
Attribute
16
Relationship
• Definition
• Example
C++
Data Member on
a persistent Class
Object Data Model
Relationship
17
Operations
• Definition
• Example
C++
Function Member
Object Data Model
Type Operation
18
SUMMARY
• The C++ ODL includes only one extension
to the C++ programming language-an
inverse clause to declare inverse
relationship
19