KEMBAR78
Chapter 5 Object Oriented Database Systems | PDF | Inheritance (Object Oriented Programming) | Method (Computer Programming)
0% found this document useful (0 votes)
16 views52 pages

Chapter 5 Object Oriented Database Systems

Chapter 5 discusses Object-Oriented Database Systems (OODBMS) and their advantages over traditional Relational Database Management Systems (RDBMS), particularly for advanced applications requiring complex data modeling. It highlights the limitations of RDBMSs, such as poor representation of real-world entities and difficulties with recursive queries, while introducing key object-oriented concepts like encapsulation, inheritance, and object identity. The chapter also outlines the next generation of database systems and various strategies for mapping object-oriented classes to relational structures.

Uploaded by

geme kelbesa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views52 pages

Chapter 5 Object Oriented Database Systems

Chapter 5 discusses Object-Oriented Database Systems (OODBMS) and their advantages over traditional Relational Database Management Systems (RDBMS), particularly for advanced applications requiring complex data modeling. It highlights the limitations of RDBMSs, such as poor representation of real-world entities and difficulties with recursive queries, while introducing key object-oriented concepts like encapsulation, inheritance, and object identity. The chapter also outlines the next generation of database systems and various strategies for mapping object-oriented classes to relational structures.

Uploaded by

geme kelbesa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 52

Chapter 5

Object Oriented
Database
Systems
Chapter 5 - Objectives
Advanced database applications.
Unsuitabilityof RDBMSs for advanced
database applications.
Object-oriented concepts.
Problems of storing objects in relational
database.
The next generation of database
systems.
Basics of object-oriented database
2 Object Oriented Database Systems 08/12/2025
analysis and design.
Introduction
We have seen the widespread acceptance
of RDBMSs for traditional business
applications such as ,
order processing,
inventory control,
banking, and
airline reservations ….etc.
However, existing RDBMSs have proven
inadequate for applications whose needs
are quite different from those of traditional
business database applications.
Those applications need to model very
3 Object Oriented Database Systems 08/12/2025
complex behavior.
Advanced Database Applications
Computer-Aided Design/Manufacturing
(CAD/CAM)
Computer-Aided Software Engineering
(CASE)
Network Management Systems
Office Information Systems (OIS) and
Multimedia Systems
Digital Publishing
Geographic Information Systems (GIS)
Interactive and Dynamic Web sites
Other applications with complex and
interrelated objects and procedural data.
4 Object Oriented Database Systems 08/12/2025
Weaknesses of RDBMSs
Poor Representation of “Real World”
Entities
Normalization leads to relations that do
not correspond to entities in “real
world”.
Semantic Overloading
Relational model has only one construct
for representing data and data
relationships: the relation.
Relational model is semantically
overloaded.
5 Object Oriented Database Systems 08/12/2025
Weaknesses of RDBMSs
Poor Support for Integrity and
Enterprise Constraints
Homogeneous Data Structure
Relational model assumes both
horizontal and vertical homogeneity.
Many RDBMSs now allow Binary Large
Objects (BLOBs).
 BLOBs are usually used to store large sized
images, audio/video or other multimedia data
in binary format

6 Object Oriented Database Systems 08/12/2025


Weaknesses of RDBMSs
Limited Operations
RDBMs only have a fixed set of
operations which cannot be extended.
Difficulty Handling Recursive Queries
Extremely difficult to produce recursive
queries.

7 Object Oriented Database Systems 08/12/2025


Example - Recursive Query

Assuming we have a recursive


relationship in a table named
category . Getting the sub
categories of a given category is
difficult.
Example. Look at the following
schema and try to solve the
above problem.
8 Object Oriented Database Systems 08/12/2025
Weaknesses of RDBMSs
Impedance Mismatch
Most DMLs lack computational
completeness.
To overcome this, SQL can be embedded
in a high-level 3GL.
This produces an impedance mismatch -
mixing different programming
paradigms.
Estimated that as much as 30% of
programming effort and code space is
expended on this type of conversion.

9 Object Oriented Database Systems 08/12/2025


Weaknesses of RDBMSs
Other Problems with RDBMSs
Transactions are generally short-lived
and concurrency control protocols not
suited for long-lived transactions.
Schema changes are difficult.
RDBMSs are poor at navigational access.

10 Object Oriented Database Systems 08/12/2025


Object-Oriented Concepts
Abstraction, encapsulation, information
hiding.
Objects and attributes.
Object identity.
Methods and messages.
Classes, subclasses, superclasses, and
inheritance.
Overloading.
Polymorphism and dynamic binding.

11 Object Oriented Database Systems 08/12/2025


Abstraction
Process of identifying essential aspects
of an entity and ignoring unimportant
properties ( details).
Concentrate on what an object is and
what it does, before deciding how to
implement it.

12 Object Oriented Database Systems 08/12/2025


Encapsulation and Information
Hiding
Encapsulation
Object contains both data structure
and set of operations used to
manipulate it.
Information Hiding
Separate external aspects of an object
from its internal details, which are
hidden from outside.
Eg. Private field vs. Public properties

 Allows internal details of an object to be


changed without affecting applications
that use it, provided external details
13 remain
Object same.
Oriented Database Systems 08/12/2025

Object
Uniquely identifiable entity that contains
both the attributes that describe the
state of a real-world object and the
actions associated with it.

Definition very similar to that of an


entity, however, object encapsulates
both state and behavior; an entity only
models state.

14 Object Oriented Database Systems 08/12/2025


Attributes
Contain current state of an object.
Attributes can be classified as simple or
complex.
Simple attribute can be a primitive type
such as integer, string, etc., which
takes on literal values.
Complex attribute can contain
collections and/or references to other
objects.
Reference attribute represents
relationship.
An object that contains one or more
15 Object Oriented Database Systems 08/12/2025
complex attributes is called a complex
Object Identity
Object identifier (OID) assigned to object
when it is created that is:
System-generated.
Unique to that object.
Invariant.
Independent of the values of its attributes
(that is, its state).
Invisible to the user (ideally).

16 Object Oriented Database Systems 08/12/2025


Object Identity - Implementation
In RDBMS, object identity is value-
based: primary key is used to provide
uniqueness.
Primary keys do not provide type of
object identity required in OO systems:
key only unique within a relation, not
across entire system;
key generally chosen from attributes of
relation, making it dependent on object
state.

17 Object Oriented Database Systems 08/12/2025


Object Identity - Implementation
Programming languages use variable names
and pointers/virtual memory addresses,
which also compromise object identity.
In C/C++, OID is physical address in process
memory space, which is too small - scalability
requires that OIDs be valid across storage
volumes, possibly across different computers.
Further, when object is deleted, memory is
reused, which may cause problems.
 OID can never be reused even when an object is
deleted

18 Object Oriented Database Systems 08/12/2025


Advantages of OIDs
They are efficient.
They are fast.
They cannot be modified by the user.
They are independent of content.
They cannot be used by another object
even when the object is no more in use
(Deleted).

19 Object Oriented Database Systems 08/12/2025


Methods and Messages
Method
Defines behavior of an object, as a set
of encapsulated functions.

Message
Request from one object to another
asking second object to execute one of
its methods.

20 Object Oriented Database Systems 08/12/2025


Object Showing Attributes and
Methods

21 Object Oriented Database Systems 08/12/2025


Example of a Method

22 Object Oriented Database Systems 08/12/2025


Class
Blueprint for defining a set of similar
objects.

Objects in a class are called instances.


Class is also an object with own class
attributes and class methods.

23 Object Oriented Database Systems 08/12/2025


Class Instance Share Attributes and
Methods

24 Object Oriented Database Systems 08/12/2025


Subclasses, Superclasses, and
Inheritance
Inheritance allows one class of objects
to be defined as a special case of a
more general class.
Special cases are subclasses and more
general cases are superclasses.
Process of forming a superclass is
generalization; forming a subclass is
specialization.
Subclass inherits all properties of its
superclass and can define its own
unique properties.
Subclass can redefine inherited
25 Object Oriented Database Systems 08/12/2025
methods.
Subclasses, Superclasses, and
Inheritance
All instances of subclass are also
instances of superclass.
Principle of substitutability states that
instance of subclass can be used
whenever method/construct expects
instance of superclass.
Relationship between subclass and
superclass known as A KIND OF (AKO)
relationship.
Four types of inheritance: single,
multiple, repeated, and selective.

26 Object Oriented Database Systems 08/12/2025


Single Inheritance

27 Object Oriented Database Systems 08/12/2025


Multiple Inheritance

28 Object Oriented Database Systems 08/12/2025


Repeated Inheritance

29 Object Oriented Database Systems 08/12/2025


Selective inheritance
Allows a subclass to inherit a limited
number of properties from the superclass.
This feature may provide similar
functionality to the view mechanism in
relational databases

30 Object Oriented Database Systems 08/12/2025


Overriding, Overloading, and
Polymorphism
Overriding
Process of redefining a member within
a subclass.

Overloading
Allows name of a method to be reused
with a class or across classes.

Polymorphism
Means ‘many forms’. Three types:
operation, inclusion, and parametric.

31 Object Oriented Database Systems 08/12/2025


Complex Objects
An object that consists of subobjects
but is viewed as a single object.
Objects participate in a A-PART-OF
(APO) relationship.
Contained object can be encapsulated
within complex object, accessed by
complex object’s methods.
Or have its own independent existence,
and only an OID is stored in complex
object.

32 Object Oriented Database Systems 08/12/2025


Storing Objects in Relational
Databases
One approach to achieving persistence with an
OOPL is to use an RDBMS as the underlying
storage engine.
Requires mapping class instances (i.e. objects) to one
or more tuples distributed over one or more
relations.
To handle class hierarchy, have two basics tasks to
perform:
(1) design relations to represent class hierarchy;
(2) design how objects will be accessed.

33 Object Oriented Database Systems 08/12/2025


Storing Objects in Relational
Databases

34 Object Oriented Database Systems 08/12/2025


Mapping Classes to Relations
Number of strategies for mapping
classes to relations, although each
results in a loss of semantic
information.
(1) Map each class or subclass to a
relation:
Staff (staffNo, fName, lName, position, sex, DOB, salary)
Manager (staffNo, bonus, mgrStartDate)
SalesPersonnel (staffNo, salesArea, carAllowance)
Secretary (staffNo, typingSpeed)

35 Object Oriented Database Systems 08/12/2025


Mapping Classes to Relations
(2) Map each subclass to a relation
Manager (staffNo, fName, lName, position, sex, DOB,
salary, bonus, mgrStartDate)
SalesPersonnel (staffNo, fName, lName, position, sex,
DOB, salary, salesArea, carAllowance)
Secretary (staffNo, fName, lName, position, sex, DOB,
salary, typingSpeed)
(3) Map the hierarchy to a single relation
Staff (staffNo, fName, lName, position, sex, DOB, salary,
bonus, mgrStartDate, salesArea, carAllowance,
typingSpeed, typeFlag)

36 Object Oriented Database Systems 08/12/2025


Next Generation Database Systems
First Generation DBMS: Network and
Hierarchical
Required complex programs for even
simple queries.
Minimal data independence.
No widely accepted theoretical
foundation.
Second Generation DBMS: Relational
DBMS
Helped overcome these problems.

37 Third Generation
Object Oriented DBMS: OODBMS and
Database Systems 08/12/2025
History of Data Models

38 Object Oriented Database Systems 08/12/2025


Object-Oriented Database Design

39 Object Oriented Database Systems 08/12/2025


Relationships
Relationships represented using
reference attributes, typically
implemented using OIDs.
Consider how to represent following
binary relationships according to their
cardinality:
1:1
1:*
*:*.

40 Object Oriented Database Systems 08/12/2025


1:1 Relationship Between Objects A
and B
Add reference attribute to A and, to
maintain referential integrity, reference
attribute to B.

41 Object Oriented Database Systems 08/12/2025


1:* Relationship Between Objects A
and B
Add reference attribute to B and
attribute containing set of references to
A.

42 Object Oriented Database Systems 08/12/2025


*:* Relationship Between Objects A
and B
Add attribute containing set of
references to each object.
For relational database design, would
decompose *:N into two 1:*
relationships linked by intermediate
entity. Can also represent this model in
an ODBMS.

43 Object Oriented Database Systems 08/12/2025


*:* Relationships

44 Object Oriented Database Systems 08/12/2025


Alternative Design for *:*
Relationships

45 Object Oriented Database Systems 08/12/2025


Referential Integrity

Several techniques to handle referential


integrity:

Do not allow user to explicitly delete


objects.
System is responsible for “garbage
collection”.
Allow user to delete objects when they
are no longer required.
 System may detect invalid
references automatically and set
46
reference to NULL or disallow 08/12/2025
Object Oriented Database Systems
the
deletion.
Referential Integrity
Allow user to modify and delete objects
and relationships when they are no
longer required.
System automatically maintains the
integrity of objects.
Inverse attributes can be used to
maintain referential integrity.

47 Object Oriented Database Systems 08/12/2025


Object-Oriented Data Model
No one agreed object data model. One
definition:
Object-Oriented Data Model (OODM)
Data model that captures semantics of
objects supported in object-oriented
programming.
Object-Oriented Database (OODB)
Persistent and sharable collection of
objects defined by an ODM.
Object-Oriented DBMS (OODBMS)
Manager of an ODB.
48 Object Oriented Database Systems 08/12/2025
Object-Oriented Data Model
Zdonik and Maier present a threshold
model that an OODBMS must, at a
minimum, satisfy:
It must provide database functionality.
It must support object identity.
It must provide encapsulation.
It must support objects with complex
state.

49 Object Oriented Database Systems 08/12/2025


Object-Oriented Data Model
Khoshafian and Abnous define OODBMS
as:
OO = Abstract Data Types (ADTs) +
Inheritance + Object identity
OODBMS = OO + Database capabilities.
Parsaye et al. gives:
1. High-level query language with query
optimization.
2. Support for persistence, atomic
transactions: concurrency and recovery
control.
3. Support for complex object storage,
50 Object Oriented Database Systems 08/12/2025
indexes, and access methods.
Commercial OODBMSs
GemStone from Gemstone Systems Inc.,
Objectivity/DB from Objectivity Inc.,
ObjectStore from Progress Software
Corp.,
Ontos from Ontos Inc.,
FastObjects from Poet Software Corp.,
Jasmine from Computer
Associates/Fujitsu,
Versant from Versant Corp.

51 Object Oriented Database Systems 08/12/2025


Origins of the Object-Oriented Data
Model

52 Object Oriented Database Systems 08/12/2025

You might also like