SlideShare a Scribd company logo
1 of 73
11
Chapter 11
Object-Oriented Databases
Database Systems: Design, Implementation, and Management
4th Edition
Peter Rob & Carlos Coronel
11
Chapter 11
Object-Oriented Databases
Database Systems: Design, Implementation, and Management
4th Edition
Peter Rob & Carlos Coronel
11
Object Schemas: The Graphical
Representation of Objects
Figure 11.14 Shared Representation For All Objects Of the Class Person
11
State Of A Person Object Instance
Figure 11.15
11
Defining Three Abstract Data Types
Figure 11.16
11
Object Representation For Instances Of The
Class Person With ADTs
Figure 11.17
11
 The object
space or
object schema
is the
equivalent of a
database
schema or a
relational
schema at a
given time.
Object Schemas: The Graphical
Representation of Objects
Figure 11.18
11
Figure 11.19 Referential Sharing Of Objects
11
 Class-Subclass Relationships
Object Schemas: The Graphical
Representation of Objects
Figure 11.20 Class Hierarchy
11
Employee Object Representation
Figure 11.21
11
 Interobject Relationships: Attribute-Class Link
 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
Object Schemas: The Graphical
Representation of Objects
11
Class Hierarchy For The EDLP Retail Corporation
Figure 11.22
11
 Representing 1:M Relationships
 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.
Object Schemas: The Graphical
Representation of Objects
11
Representing The 1:M Relationship
Figure 11.23
11
Representing The 1:1 And 1:M Relationships
Figure 11.24
11
Employee-Dependent Relationship
Figure 11.25
11
 Representing M:N Relationships
Object Schemas: The Graphical
Representation of Objects
Figure 11.26
11
 Representing M:N Relationships with an
Intersection Class
Object Schemas: The Graphical
Representation of Objects
Figure 11.27 Representing the M:N Relationship With Associated Attributes
11
Representing The M:N Relationship With Intersection Class
Figure 11.28
11
Figure 11.29 Object Space Representation
11
 Late and Early Binding: Use and Importance
 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.
Object Schemas: The Graphical
Representation of Objects
11
Inventory Table With Predetermined (Base) Data Types
Figure 11.30
11
Inventory Class With Early Binding
Figure 11.31
11
OODM Inventory Class With Late Binding
Figure 11.32
11
 Support for Versioning
 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.
Object Schemas: The Graphical
Representation of Objects
11
OODM and Previous Data Models
 Object, Entity, and Tuple
 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.
11
An Invoice Representation
Figure 11.33
11
OODM and Previous Data Models
 Class, Entity Set, and Table
 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.
11
OODM and Previous Data Models
 Object ID
 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.
11
OODM and Previous Data Models
 Access
 E-R and relational models use an ad hoc, set-
oriented query language.
 OODM is suited to support both navigational and
set-oriented access.
11
Object-Oriented DBMS
Figure 11.34
11
Table 11.4 The Thirteen OODBMS Rules
11
How OO Affects Database Design
 OO database design approach provides both the data
identification and the procedures or data
manipulation to be performed.
 OO database design forces us to think of data and
procedures as a self-contained entity.
 OO design is iterative and incremental in nature.
 DBA’s role is likely to change with more
programming responsibilities.
 Lack of standards affects OO database design.
11
OODBMS: Advantages and
Disadvantages
 Advantages
 More semantic information.
 Support for complex objects.
 Extensibility of data types.
 Improved performance with efficient caching.
 Versioning.
 Faster development and easy maintenance through
inheritance and reusability.
 Technology-driven product for next generation DBMS.
 Potential to integrate DBMSs into a single environment.
11
 Disadvantages
 Strong opposition from the established players.
 Lack of theoretical foundation.
 Retrogressive to the old pointer systems.
 Lack of standard ad hoc query language.
 Lack of business data design and management tools.
 Steep learning curve.
 Lack of resources.
OODBMS: Advantages and
Disadvantages
11
How OO Concepts Have Influenced the
Relational Model
 New Features for Extended Relational
(Object/Relational) Model
 Extensibility of new user-defined (abstract) data
types
 Complex objects
 Inheritance
 Procedure calls (rules or triggers)
 System-generated identifiers (OID surrogates)
11
How OO Concepts Have Influenced the
Relational Model
 Philosophy that guides the relational model’s
enhancements:
 Semantic and object-oriented concepts are
necessary to support the new generation of
applications.
 These concepts can and must be added to the
relational model.
 The benefits of the relational model must be
preserved to protect the investment in relational
technology and to provide downward compatibility.
11
The Next Generation of DBMS
 The next generation of DBMS is likely to
incorporate features borrowed from:
 Object-oriented database systems
 Artificial intelligence systems
 Expert systems
 Distributed database
 The Internet
11
Object Orientation and Its Benefits
 Object orientation is a modeling and development
methodology based on object-oriented (OO)
concepts.
 Definition of Object Orientation
A set of design and development principles based on
conceptually autonomous computer structures
known as objects. Each object represents a real-
world entity with the ability to interact with itself and
with other objects.
11
Table 11.1 Object Orientation Contributions
11
The Evolution of OO Concepts
 From traditional to object-oriented
programming (OOP)
 Before OOP, data and procedures were isolated from
each other. Data were treated as the passive
component, while procedures manipulated the data as
the active component.
 Procedural languages (e.g., COBOL) encouraged the
rigid distinction between data and procedure.
 In an OOP environment, the programmer asks to
perform operations on themselves.
 OO concepts first appeared in some programming
languages and set the stage for more refined OO
concepts.
11
The Evolution of OO Concepts
 Main Objectives of Object-Oriented
Programming Languages (OOPL)
 To provide an easy-to-use software development
environment.
 To provide a powerful software modeling tool for
applications prototyping.
 To decrease development time by reducing the amount
of code.
 To improve programmer productivity by making that
code reusable.
11
The Evolution of OO Concepts
 Important Attributes of OO Environment
 The data set is no longer passive.
 Data and procedures are bound together, creating
an object.
 The object has an innate ability to act on itself.
11
Object-Oriented Concepts
 Overview
 Objects: Components and Characteristics
 Object Identity
 Attributes (Instance Variables)
 Object State
 Messages and Methods
 Classes
 Protocol
 Superclasses, Subclasses, and Inheritance
 Methods Overriding and Polymorphism
 Abstract Data Types
 Object Classification
11
Object-Oriented Concepts
 Objects: Components and Characteristics
An object is an abstract representation of a real-world
entity that has a unique identity, embedded properties, and
the ability to interact with other objects and itself.
Figure 11.1 Real World Student Objects
11
Object-Oriented Concepts
 Object Identify
 The object’s identity is represented by an object
ID (OID), which is unique to that object.
 The OID is assigned by the system at the moment
of the object’s creation and cannot be changed
under any circumstance.
 The OID can be deleted only if the object is
deleted, and that OID can never be reused.
11
Object-Oriented Concepts
 Attributes (Instance Variables)
 Objects are described by their attributes, known
as instance variables. (See Table 11.2)
 Attributes have a domain. The domain logically
groups and describes the set of all possible
values that an attribute can have.
 An attribute can be single valued or multivalued.
 Attributes may reference one or more other
objects.
11
Object Attributes
Table 11.2
11
Object-Oriented Concepts
 Object State
 The object state is the set of values that the
object’s attributes have at a given time.
 If we change the object’s state, we must change the
values of the object attributes.
 To change the object’s attribute values, we must
send a message to the object.
 This message invokes a method.
11
Object-Oriented Concepts
 Messages and Methods
 Every operation performed on an object must be
implemented by a method.
 Methods represent real-world actions and are
equivalent to procedures in traditional
programming languages.
 Every method is identified by a name and has a
body.
 The body is composed of computer instructions
written in some programming language to represent
a real-world action.
11
Depiction Of An Object
Figure 11.2
11
Object-Oriented Concepts
 Messages and Methods
 To invoke a method you send a message to the
object.
 A message is sent by specifying a receiver object,
the name of the method, and any required
parameters.
 The internal structure of the object cannot be
accessed directly by the message sender. The
ability to hide the object’s internal details (attributes
and methods) is known as encapsulation.
 An object may send messages to change or
interrogate another object’s state. (See Figure 11.3)
11
Objects Send Messages To Each Other
Figure 11.3
11
Object-Oriented Concepts
 Classes
 Objects that share common characteristics are
grouped into classes. A class is a collection of
similar objects with shared structure (attributes)
and behavior (methods).
 Each object in a class is known as a class
instance or object instance. (See Figure 11.4)
 Example: STUDENT class (See Figure 11.5)
11
Class Illustration
Figure 11.4
11
Representation Of The Class Student
Figure 11.5
11
Object-Oriented Concepts
 Protocol
 The class’s collection of messages, each
identified by a message name, constitutes the
object or class protocol.
 The protocol represents an object’s public aspect;
i.e., it is known by other objects as well as end
users.
 The implementation of the object’s structure and
methods constitutes the object’s private aspect.
 A message can be sent to an object instance or
the class. When the receiver object is a class, the
message will invoke a class method.
11
Public and Private Aspects Of An Object
Figure 11.6
11
OO Summary: Object Characteristics
Figure 11.7
11
Object-Oriented Concepts
 Superclasses, Subclasses, and Inheritance
 Classes are organized into a class hierarchy.
 Example: Musical instrument class hierarchy
(Figure 11.8)
– Piano, Violin, and Guitar are a subclass of Stringed
instruments, which is, in turn, a subclass of Musical
instruments.
– Musical instruments defines the superclass of
Stringed instruments, which is, in turn, the
superclass of the Piano, Violin, and Guitar classes.
 Inheritance is the ability of an object within the
hierarchy to inherit the data structure and
behavior (methods) of the classes above it.
11
Musical Instruments Class Hierarchy
Figure 11.8
11
Object-Oriented Concepts
 Two variants of inheritance:
 Single inheritance exists when a class has only
one immediate superclass above it.
 Most of the current OO systems support single
inheritance.
 When the system sends a message to an object
instance, the entire hierarchy is searched for the
matching method in the following sequence:
– Scan the class to which the object belongs.
– If the method is not found, scan the superclass.
 The scanning process is repeated until either one of
the following occurs:
– The method is found.
– The top of the class hierarchy is reached without
finding the message.
11
Single Inheritance
Figure 11.9
11
Object-Oriented Concepts
 Two variants of inheritance:
 Multiple inheritance allow a class to be derived
from several parent superclasses located above
that class.
 Single inheritance exists when a class has only
one immediate (parent) superclass above it.
Figure 11.10 Multiple Inheritance
11
Motor Vehicle And Bicycle Instance Variables
Figure 11.11
11
Object-Oriented Concepts
 Method Overriding and Polymorphism
 We may override a superclass’s method definition
by redefining the method at the subclass level.
(See Figure 11.12)
 Polymorphism allows different objects to respond
to the same message in different ways. (See
Figure 11.13)
11
Employee Class Hierarchy Method Override
Figure 11.12
11
Employee Class Hierarchy Polymorphism
Figure 11.13
11
Object-Oriented Concepts
 Abstract Data Types
 A data type describes a set of objects with similar
characteristics.
 All conventional programming languages use a
set of predefined data types, known as
conventional data types or base data types.
 Abstract data types (ADT) describe a set of similar
objects. An ADT differs from a conventional data
type in that:
 The ADT’s operations are user-defined.
 The ADT does not allow direct access to its internal
data representation or method implementation.
11
Object-Oriented Concepts
 Object Classification
 A simple object contains only single-valued attributes
and none of its attributes refer to another object.
 A composite object contains at least one multivalued
attribute and none of its attributes refer to another
object.
 A compound object contains at least one attribute that
references another object.
 A hybrid object contains a repeating group of
attributes, and at least one of the repeating attributes
refers to another object.
 An associative object is used to represent a
relationship between two or more objects.
11
Characteristics of an OO Data Model
 An Object-Oriented Data Model Must:
 Support the representation of complex objects.
 Be extensible; i.e., it must be capable of defining new
data types as well as the operations to be performed on
them.
 Support encapsulation; i.e., the data representation and
the method’s implementation must be hidden from
external entities.
 Exhibit inheritance; an object must be able to inherit
the properties (data and methods) of other objects.
 Support the notion of object identity (OID).
11
 Summary of OODM Components
 The OOCM models real-world entities as objects.
 Each object is composed of attributes and a set of methods.
 Each attribute can reference another object or a set of
objects.
 The attributes and the methods implementation are hidden,
or encapsulated, from other objects.
 Each object is identified by a unique object ID (OID), which
is independent of the value of its attributes.
 Similar objects are described and grouped in a class that
contains the description of the data and the method’s
implementation.
 The class describes a type of object.
 Classes are organized in a class hierarchy.
 Each object of a class inherits all properties of its
superclasses in the class hierarchy.
Characteristics of an OO Data Model
11
Comparing The OO And E-R Model Components
Table 11.3

More Related Content

Similar to CH11.ppt

Similar to CH11.ppt (20)

Chapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfChapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdf
 
DBMS-7.pptx
DBMS-7.pptxDBMS-7.pptx
DBMS-7.pptx
 
MIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptxMIT302 Lesson 2_Advanced Database Systems.pptx
MIT302 Lesson 2_Advanced Database Systems.pptx
 
Cse ii ii sem
Cse ii ii semCse ii ii sem
Cse ii ii sem
 
database-model group presentation.pptx
database-model group   presentation.pptxdatabase-model group   presentation.pptx
database-model group presentation.pptx
 
Introduction to Object Oriented databases
Introduction to Object Oriented databasesIntroduction to Object Oriented databases
Introduction to Object Oriented databases
 
RDBMS_Concept.ppt
RDBMS_Concept.pptRDBMS_Concept.ppt
RDBMS_Concept.ppt
 
parth presentation
parth presentationparth presentation
parth presentation
 
Comparison of Relational Database and Object Oriented Database
Comparison of Relational Database and Object Oriented DatabaseComparison of Relational Database and Object Oriented Database
Comparison of Relational Database and Object Oriented Database
 
DBMS OF DATA MODEL Deepika 2
DBMS OF DATA MODEL  Deepika 2DBMS OF DATA MODEL  Deepika 2
DBMS OF DATA MODEL Deepika 2
 
Data Models.ppt
Data Models.pptData Models.ppt
Data Models.ppt
 
Dbms questions
Dbms questionsDbms questions
Dbms questions
 
Db lec 01
Db lec 01Db lec 01
Db lec 01
 
Database Modelling Concepts - Chapter 1
Database Modelling Concepts - Chapter 1Database Modelling Concepts - Chapter 1
Database Modelling Concepts - Chapter 1
 
Corporate data handling
Corporate data handlingCorporate data handling
Corporate data handling
 
OOAD unit1 introduction to object orientation
 OOAD unit1 introduction to object orientation OOAD unit1 introduction to object orientation
OOAD unit1 introduction to object orientation
 
DBMS
DBMSDBMS
DBMS
 
Odbms concepts
Odbms conceptsOdbms concepts
Odbms concepts
 
Concepts for Object Oriented Databases.ppt
Concepts for Object Oriented Databases.pptConcepts for Object Oriented Databases.ppt
Concepts for Object Oriented Databases.ppt
 
Ooadb
OoadbOoadb
Ooadb
 

More from ssuser5c874e

More from ssuser5c874e (6)

CH08.ppt
CH08.pptCH08.ppt
CH08.ppt
 
week-1-200310134908.pptx
week-1-200310134908.pptxweek-1-200310134908.pptx
week-1-200310134908.pptx
 
CH12.ppt
CH12.pptCH12.ppt
CH12.ppt
 
CH09.ppt
CH09.pptCH09.ppt
CH09.ppt
 
data_structures_and_applications_-_module-4.ppt
data_structures_and_applications_-_module-4.pptdata_structures_and_applications_-_module-4.ppt
data_structures_and_applications_-_module-4.ppt
 
CH08.ppt
CH08.pptCH08.ppt
CH08.ppt
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 

Recently uploaded (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

CH11.ppt

  • 1. 11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel
  • 2. 11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel
  • 3. 11 Object Schemas: The Graphical Representation of Objects Figure 11.14 Shared Representation For All Objects Of the Class Person
  • 4. 11 State Of A Person Object Instance Figure 11.15
  • 5. 11 Defining Three Abstract Data Types Figure 11.16
  • 6. 11 Object Representation For Instances Of The Class Person With ADTs Figure 11.17
  • 7. 11  The object space or object schema is the equivalent of a database schema or a relational schema at a given time. Object Schemas: The Graphical Representation of Objects Figure 11.18
  • 8. 11 Figure 11.19 Referential Sharing Of Objects
  • 9. 11  Class-Subclass Relationships Object Schemas: The Graphical Representation of Objects Figure 11.20 Class Hierarchy
  • 11. 11  Interobject Relationships: Attribute-Class Link  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 Object Schemas: The Graphical Representation of Objects
  • 12. 11 Class Hierarchy For The EDLP Retail Corporation Figure 11.22
  • 13. 11  Representing 1:M Relationships  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. Object Schemas: The Graphical Representation of Objects
  • 14. 11 Representing The 1:M Relationship Figure 11.23
  • 15. 11 Representing The 1:1 And 1:M Relationships Figure 11.24
  • 17. 11  Representing M:N Relationships Object Schemas: The Graphical Representation of Objects Figure 11.26
  • 18. 11  Representing M:N Relationships with an Intersection Class Object Schemas: The Graphical Representation of Objects Figure 11.27 Representing the M:N Relationship With Associated Attributes
  • 19. 11 Representing The M:N Relationship With Intersection Class Figure 11.28
  • 20. 11 Figure 11.29 Object Space Representation
  • 21. 11  Late and Early Binding: Use and Importance  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. Object Schemas: The Graphical Representation of Objects
  • 22. 11 Inventory Table With Predetermined (Base) Data Types Figure 11.30
  • 23. 11 Inventory Class With Early Binding Figure 11.31
  • 24. 11 OODM Inventory Class With Late Binding Figure 11.32
  • 25. 11  Support for Versioning  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. Object Schemas: The Graphical Representation of Objects
  • 26. 11 OODM and Previous Data Models  Object, Entity, and Tuple  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.
  • 28. 11 OODM and Previous Data Models  Class, Entity Set, and Table  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.
  • 29. 11 OODM and Previous Data Models  Object ID  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.
  • 30. 11 OODM and Previous Data Models  Access  E-R and relational models use an ad hoc, set- oriented query language.  OODM is suited to support both navigational and set-oriented access.
  • 32. 11 Table 11.4 The Thirteen OODBMS Rules
  • 33. 11 How OO Affects Database Design  OO database design approach provides both the data identification and the procedures or data manipulation to be performed.  OO database design forces us to think of data and procedures as a self-contained entity.  OO design is iterative and incremental in nature.  DBA’s role is likely to change with more programming responsibilities.  Lack of standards affects OO database design.
  • 34. 11 OODBMS: Advantages and Disadvantages  Advantages  More semantic information.  Support for complex objects.  Extensibility of data types.  Improved performance with efficient caching.  Versioning.  Faster development and easy maintenance through inheritance and reusability.  Technology-driven product for next generation DBMS.  Potential to integrate DBMSs into a single environment.
  • 35. 11  Disadvantages  Strong opposition from the established players.  Lack of theoretical foundation.  Retrogressive to the old pointer systems.  Lack of standard ad hoc query language.  Lack of business data design and management tools.  Steep learning curve.  Lack of resources. OODBMS: Advantages and Disadvantages
  • 36. 11 How OO Concepts Have Influenced the Relational Model  New Features for Extended Relational (Object/Relational) Model  Extensibility of new user-defined (abstract) data types  Complex objects  Inheritance  Procedure calls (rules or triggers)  System-generated identifiers (OID surrogates)
  • 37. 11 How OO Concepts Have Influenced the Relational Model  Philosophy that guides the relational model’s enhancements:  Semantic and object-oriented concepts are necessary to support the new generation of applications.  These concepts can and must be added to the relational model.  The benefits of the relational model must be preserved to protect the investment in relational technology and to provide downward compatibility.
  • 38. 11 The Next Generation of DBMS  The next generation of DBMS is likely to incorporate features borrowed from:  Object-oriented database systems  Artificial intelligence systems  Expert systems  Distributed database  The Internet
  • 39. 11 Object Orientation and Its Benefits  Object orientation is a modeling and development methodology based on object-oriented (OO) concepts.  Definition of Object Orientation A set of design and development principles based on conceptually autonomous computer structures known as objects. Each object represents a real- world entity with the ability to interact with itself and with other objects.
  • 40. 11 Table 11.1 Object Orientation Contributions
  • 41. 11 The Evolution of OO Concepts  From traditional to object-oriented programming (OOP)  Before OOP, data and procedures were isolated from each other. Data were treated as the passive component, while procedures manipulated the data as the active component.  Procedural languages (e.g., COBOL) encouraged the rigid distinction between data and procedure.  In an OOP environment, the programmer asks to perform operations on themselves.  OO concepts first appeared in some programming languages and set the stage for more refined OO concepts.
  • 42. 11 The Evolution of OO Concepts  Main Objectives of Object-Oriented Programming Languages (OOPL)  To provide an easy-to-use software development environment.  To provide a powerful software modeling tool for applications prototyping.  To decrease development time by reducing the amount of code.  To improve programmer productivity by making that code reusable.
  • 43. 11 The Evolution of OO Concepts  Important Attributes of OO Environment  The data set is no longer passive.  Data and procedures are bound together, creating an object.  The object has an innate ability to act on itself.
  • 44. 11 Object-Oriented Concepts  Overview  Objects: Components and Characteristics  Object Identity  Attributes (Instance Variables)  Object State  Messages and Methods  Classes  Protocol  Superclasses, Subclasses, and Inheritance  Methods Overriding and Polymorphism  Abstract Data Types  Object Classification
  • 45. 11 Object-Oriented Concepts  Objects: Components and Characteristics An object is an abstract representation of a real-world entity that has a unique identity, embedded properties, and the ability to interact with other objects and itself. Figure 11.1 Real World Student Objects
  • 46. 11 Object-Oriented Concepts  Object Identify  The object’s identity is represented by an object ID (OID), which is unique to that object.  The OID is assigned by the system at the moment of the object’s creation and cannot be changed under any circumstance.  The OID can be deleted only if the object is deleted, and that OID can never be reused.
  • 47. 11 Object-Oriented Concepts  Attributes (Instance Variables)  Objects are described by their attributes, known as instance variables. (See Table 11.2)  Attributes have a domain. The domain logically groups and describes the set of all possible values that an attribute can have.  An attribute can be single valued or multivalued.  Attributes may reference one or more other objects.
  • 49. 11 Object-Oriented Concepts  Object State  The object state is the set of values that the object’s attributes have at a given time.  If we change the object’s state, we must change the values of the object attributes.  To change the object’s attribute values, we must send a message to the object.  This message invokes a method.
  • 50. 11 Object-Oriented Concepts  Messages and Methods  Every operation performed on an object must be implemented by a method.  Methods represent real-world actions and are equivalent to procedures in traditional programming languages.  Every method is identified by a name and has a body.  The body is composed of computer instructions written in some programming language to represent a real-world action.
  • 51. 11 Depiction Of An Object Figure 11.2
  • 52. 11 Object-Oriented Concepts  Messages and Methods  To invoke a method you send a message to the object.  A message is sent by specifying a receiver object, the name of the method, and any required parameters.  The internal structure of the object cannot be accessed directly by the message sender. The ability to hide the object’s internal details (attributes and methods) is known as encapsulation.  An object may send messages to change or interrogate another object’s state. (See Figure 11.3)
  • 53. 11 Objects Send Messages To Each Other Figure 11.3
  • 54. 11 Object-Oriented Concepts  Classes  Objects that share common characteristics are grouped into classes. A class is a collection of similar objects with shared structure (attributes) and behavior (methods).  Each object in a class is known as a class instance or object instance. (See Figure 11.4)  Example: STUDENT class (See Figure 11.5)
  • 56. 11 Representation Of The Class Student Figure 11.5
  • 57. 11 Object-Oriented Concepts  Protocol  The class’s collection of messages, each identified by a message name, constitutes the object or class protocol.  The protocol represents an object’s public aspect; i.e., it is known by other objects as well as end users.  The implementation of the object’s structure and methods constitutes the object’s private aspect.  A message can be sent to an object instance or the class. When the receiver object is a class, the message will invoke a class method.
  • 58. 11 Public and Private Aspects Of An Object Figure 11.6
  • 59. 11 OO Summary: Object Characteristics Figure 11.7
  • 60. 11 Object-Oriented Concepts  Superclasses, Subclasses, and Inheritance  Classes are organized into a class hierarchy.  Example: Musical instrument class hierarchy (Figure 11.8) – Piano, Violin, and Guitar are a subclass of Stringed instruments, which is, in turn, a subclass of Musical instruments. – Musical instruments defines the superclass of Stringed instruments, which is, in turn, the superclass of the Piano, Violin, and Guitar classes.  Inheritance is the ability of an object within the hierarchy to inherit the data structure and behavior (methods) of the classes above it.
  • 61. 11 Musical Instruments Class Hierarchy Figure 11.8
  • 62. 11 Object-Oriented Concepts  Two variants of inheritance:  Single inheritance exists when a class has only one immediate superclass above it.  Most of the current OO systems support single inheritance.  When the system sends a message to an object instance, the entire hierarchy is searched for the matching method in the following sequence: – Scan the class to which the object belongs. – If the method is not found, scan the superclass.  The scanning process is repeated until either one of the following occurs: – The method is found. – The top of the class hierarchy is reached without finding the message.
  • 64. 11 Object-Oriented Concepts  Two variants of inheritance:  Multiple inheritance allow a class to be derived from several parent superclasses located above that class.  Single inheritance exists when a class has only one immediate (parent) superclass above it. Figure 11.10 Multiple Inheritance
  • 65. 11 Motor Vehicle And Bicycle Instance Variables Figure 11.11
  • 66. 11 Object-Oriented Concepts  Method Overriding and Polymorphism  We may override a superclass’s method definition by redefining the method at the subclass level. (See Figure 11.12)  Polymorphism allows different objects to respond to the same message in different ways. (See Figure 11.13)
  • 67. 11 Employee Class Hierarchy Method Override Figure 11.12
  • 68. 11 Employee Class Hierarchy Polymorphism Figure 11.13
  • 69. 11 Object-Oriented Concepts  Abstract Data Types  A data type describes a set of objects with similar characteristics.  All conventional programming languages use a set of predefined data types, known as conventional data types or base data types.  Abstract data types (ADT) describe a set of similar objects. An ADT differs from a conventional data type in that:  The ADT’s operations are user-defined.  The ADT does not allow direct access to its internal data representation or method implementation.
  • 70. 11 Object-Oriented Concepts  Object Classification  A simple object contains only single-valued attributes and none of its attributes refer to another object.  A composite object contains at least one multivalued attribute and none of its attributes refer to another object.  A compound object contains at least one attribute that references another object.  A hybrid object contains a repeating group of attributes, and at least one of the repeating attributes refers to another object.  An associative object is used to represent a relationship between two or more objects.
  • 71. 11 Characteristics of an OO Data Model  An Object-Oriented Data Model Must:  Support the representation of complex objects.  Be extensible; i.e., it must be capable of defining new data types as well as the operations to be performed on them.  Support encapsulation; i.e., the data representation and the method’s implementation must be hidden from external entities.  Exhibit inheritance; an object must be able to inherit the properties (data and methods) of other objects.  Support the notion of object identity (OID).
  • 72. 11  Summary of OODM Components  The OOCM models real-world entities as objects.  Each object is composed of attributes and a set of methods.  Each attribute can reference another object or a set of objects.  The attributes and the methods implementation are hidden, or encapsulated, from other objects.  Each object is identified by a unique object ID (OID), which is independent of the value of its attributes.  Similar objects are described and grouped in a class that contains the description of the data and the method’s implementation.  The class describes a type of object.  Classes are organized in a class hierarchy.  Each object of a class inherits all properties of its superclasses in the class hierarchy. Characteristics of an OO Data Model
  • 73. 11 Comparing The OO And E-R Model Components Table 11.3

Editor's Notes

  1. 1
  2. 1
  3. 50
  4. 51
  5. 52
  6. 53
  7. 54
  8. 56
  9. 57
  10. 58
  11. 59
  12. 60
  13. 61
  14. 62
  15. 62
  16. 62
  17. 72
  18. 72
  19. 73
  20. 74
  21. 75
  22. 76
  23. 77
  24. 78
  25. 79
  26. 80
  27. 82
  28. 83
  29. 84
  30. 85
  31. 86
  32. 86
  33. 5
  34. 6
  35. 7
  36. 8
  37. 9
  38. 10
  39. 11
  40. 12
  41. 13
  42. 14
  43. 15
  44. 16
  45. 17
  46. 18
  47. 19
  48. 20
  49. 21
  50. 22
  51. 23
  52. 24
  53. 25
  54. 26
  55. 27
  56. 28
  57. 29
  58. 30
  59. 32
  60. 33
  61. 34
  62. 35
  63. 36
  64. 37
  65. 47
  66. 48
  67. 49