Pertemuan 6 The structure part of object data model (Lanjutan) Matakuliah

Download Report

Transcript Pertemuan 6 The structure part of object data model (Lanjutan) Matakuliah

Matakuliah
Tahun
Versi
: M0174/OBJECT ORIENTED DATABASE
: 2005
: 1/0
Pertemuan 6
The structure part of object data
model (Lanjutan)
1
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• Mahasiswa dapat Menjelaskan struktur
object data model Lanjutan (C2)
2
Outline Materi
• Object types
• Representation of composite entities
3
Object types
• Object which have the same characteristic
can be categorized into object type.
• Each object is an instance of the object
type on which it was defined.
• The set of all instance of an object type is
called the object type’s extent.
• The new object are created using a
operation called ‘new’ on an object which
is an instance of a special type called
ObjectFactory.
4
Object types
• When designing an object database it is
necessary to define an object type for
each set of similar entities that are to be
represented in the database.
• The set of object type definition for
database is called the object database
schema.
5
Object types
• Definition of an Object Types
– An object type definition is consist in three
parts:
• Type Properties
• Instance Properties
• Instance Operation
– Note that an object type definition doesn’t
provide a complete definition of the object
type, since it doesn’t define what the
operations on instance do.
6
Object types
– The object data model distinguishes
between two aspects of an object type:
• The type’s interface: this first aspect is the
object type abstract appearance. An interface
of an object type defines only information
relating to the behavior of the type instance. It
doesn’t provide the additional information
necessary to create instance of the type.
• Object creation: the second aspect is the
ability to create object which are instance of
the object type. A type which can be
instantiated is defined by a class definition.
7
Object types
• Notation for Denoting
Object Type
– We shall use two
notations for
describing object type,
one graphical and the
other textual
Customer
-Customer_ID : String
-Name : String
-Address : String
-Telp : String
+PlaceOrder() : Boolean
+Change_Addr() : Boolean
+Change_Telp() : Boolean
8
Object types
9
Object types
• Object Type Properties
– Object types are themselves entities within object
database system and are represented as objects.
– This type of object is called a meta object, because
it describes the characteristics of other objects.
– The data contained in meta objects is called
metadata.
– The meta objects collectively define the object
database schema and are used by the ODBMS to
define and access objects contained in object
database.
10
Object types
– The metadata is stored in schema repository
for use by tools and application program.
– The meta objects which represent an object
type have properties of their own. The values
for these are specified in the type properties
part of a class definition
11
Object types
– The following properties can be specified:
• Supertype: the supertype of an interface or class
• Extender: the class that is extended by the
specified object type
• Extent: the extent of an object type is the
collections of its instance.
• Key: the instance properties that are to act as
object key
12
Object types
• Instance Properties
– An object type instance properties are the
attributes and relationships of the instance of
the object type.
– Each attribute has a name and a type which
defines the set of values that can be assigned
to the attribute.
13
Object types
– An object type instance properties are the
attributes and relationships of the instance of
the object type.
– Each attribute has a name and a type which
defines the set of values that can be assigned
to the attribute.
14
Object types
• Instance Operation
– Each instance operation has a name and
type. An operation type define the types of the
objects accepted as parameters and the type
of the object returned by operation is a
operation value.
– Each operation has a meaning or semantic.
The semantic of an operation is a declaration
of what is does when it is executed.
15
Representation of composite entities
• Collection Object Type
– Set< T >
• A set is an unordered collection of distinct objects
of the same type.
– Bag< T >
• A bag is an unordered collection of objects of the
same type, but not necessary distinct.
– List< T >
• A list is an ordered bag. Object is in list are in a
sequence. All objects in list are the same type.
16
Representation of composite entities
– Array< T >
• An array is a collection of objects in which each
object is stored at a particular position. However
position in the array may be empty.
– Dictionary< T >
• A dictionary is a set of structure, each of which is
an object pair. A dictionary may be thought of as a
list lookup table. The first object in a pair acts as a
key for accessing the second
17
SUMMARY
• Objects with the same characteristics can
be categorized into object types
• An object type together with an
implementation is called an
implementation class
• An object type can be defined in one of
three ways
18