Transcript OODM

Chapter 11
11
Object-Oriented Databases
Database Systems: Design, Implementation, and Management
4th Edition
Peter Rob & Carlos Coronel
Object Schemas: The Graphical
Representation of Objects
11
Figure 11.14 Shared Representation For All Objects Of the Class Person
State Of A Person Object Instance
11
Figure 11.15
Defining Three Abstract Data Types
11
Figure 11.16
Object Representation For Instances Of The
Class Person With ADTs
11
Figure 11.17
Object Schemas: The Graphical
Representation of Objects
11
 The object
space or
object schema
is the
equivalent of a
database
schema or a
relational
schema at a
given time.
Figure 11.18
11
Figure 11.19 Referential Sharing Of Objects
Object Schemas: The Graphical
Representation of Objects
 Class-Subclass Relationships
11
Figure 11.20 Class Hierarchy
Employee Object Representation
11
Figure 11.21
Object Schemas: The Graphical
Representation of Objects
 Interobject Relationships: Attribute-Class Link
11

A attribute-class or interobject relationship is created
when an object’s attribute references another object of
the same or different class.

Relationship Representation:

Representing 1:M Relationships

Representing M:N Relationships

Representing M:N Relationships with an
Intersection Class
Class Hierarchy For The EDLP Retail Corporation
11
Figure 11.22
Object Schemas: The Graphical
Representation of Objects
 Representing 1:M Relationships
11

Related classes are enclosed in boxes to make
relationships more noticeable.

The double line on the box’s right side indicates
that the relationship is mandatory.

Connectivity is indicated by labeling each box.
Representing The 1:M Relationship
11
Figure 11.23
Representing The 1:1 And 1:M Relationships
11
Figure 11.24
Employee-Dependent Relationship
11
Figure 11.25
Object Schemas: The Graphical
Representation of Objects
 Representing M:N Relationships
11
Figure 11.26
Object Schemas: The Graphical
Representation of Objects
 Representing M:N Relationships with an
Intersection Class
11
Figure 11.27 Representing the M:N Relationship With Associated Attributes
Representing The M:N Relationship With Intersection Class
11
Figure 11.28
11
Figure 11.29 Object Space Representation
Object Schemas: The Graphical
Representation of Objects
 Late and Early Binding: Use and Importance
11

With late binding the data type of an attribute is
not known until execution time or run-time.

Late binding allows two different object instances
of the same class to contain values of different
data types for the same attribute.

Early binding allows the database to check the
data type for each of the attribute’s values at
compilation or definition time.
Inventory Table With Predetermined (Base) Data Types
11
Figure 11.30
Inventory Class With Early Binding
11
Figure 11.31
OODM Inventory Class With Late Binding
11
Figure 11.32
Object Schemas: The Graphical
Representation of Objects
 Support for Versioning
11

Versioning is an OODM feature that allows us to
track the history of change in the state of an
object.

It is a very powerful modeling feature, especially
in a CAD environment.
OODM and Previous Data Models
 Object, Entity, and Tuple
11

An OODM object has additional characteristics
such as behavior, inheritance, and encapsulation.

Such characteristics make OO modeling much
more natural than E-R and relational modeling.
An Invoice Representation
11
Figure 11.33
OODM and Previous Data Models
 Class, Entity Set, and Table
11

Class is a more powerful concept that allows not only
the description of the data structure but also the
description of the behavior.

A class allows both the concept and the
implementation of abstract data types.
 Encapsulation and Inheritance

An object belonging to a class inherits all the
properties of its superclasses.

Encapsulation hides the data representation and the
method’s implementation from other objects and the
user.
OODM and Previous Data Models
 Object ID
11

Object ID is not supported in either the E-R model
or the relational model.

The hierarchical and the CODASYL models
support some form of ID.
 Relationships

Relationships in an OODM can be of two types:
interclass references or class hierarchy
inheritance.

E-R and relational models use a value-based
relationship approach.
OODM and Previous Data Models
 Access
11

E-R and relational models use an ad hoc, setoriented query language.

OODM is suited to support both navigational and
set-oriented access.