Chapter 9.DBMS

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 29

C H A P T E R 9

OBJECT-ORIENTED
DATABASE MANAGEMENT
INTRODUCTION
• ‘‘object orientation,’’ began during the 1980s
(DATACENTRIC APPROACH)

• began with object- oriented programming, then object-oriented


systems analysis and object-oriented systems design, and finally
object-oriented database management, complete with object-
oriented database management systems (OODBMS)
RELATIONAL DATABASE
VS.
OBJECT-ORIENTED DATABASE
ADVANTAGES OF OODBMS
• each unit of data or ‘‘object’’ has an object identifier that is

permanent and unique among all objects of all types in the system

• OODBMSs are implemented as pointer-based systems

• OODBMSs are the most natural data storage vehicles when using

object-oriented programming languages,such as C++, Smalltalk, and

Java
TERMINOLOGY
OBJECT
• an advanced data structure that includes an entity’s attributes

METHODS OR OPERATIONS OR
PROCEDURES
• Also known as “program code” that can operate on and modify the object’s
attribute values

OBJECT CLASS
• Or simply a “class”
• the objects that describe similar entities
Unified Modeling Language
(UML)
• 1997, Object Management Group (OMG)

• has nine standard diagrams that describe such features as the

system’s data, its business processes, its intended results,

the components of its program code, and its hardware and

software architectures
UML Class Diagram

• describes the system’s data, including attributes of and

relationships among the ‘‘objects”


COMPLEX
RELATIONSHIPS
Generalization
• also known as ‘‘generalization/specialization”

• a relationship that recognizes that some kinds of entities can

be subdivided into smaller, more specialized groups


OFFICE
PK Office
Number
Telephone Size

Occupied by Works in

SALESPERSON CUSTOMER
PK Salesperson PK Customer
Number Number
Sells to

General Hardware Co. Salesperson Name


Commission Percentage
Year of Hire
Buys from
Customer Name
HQ City

entity-relationship Sold Sold by


Employs

Employed by

diagram SALES
PK Salesperson
CUSTOMER EMPLOYEE
PK Customer
Number Number
PK Product PK Employee

(Figure 9.2) Number


Quantity
Employee Name
Number

Title

Sold
 
Sold Product
 
PRODUCT
PK Product
Number
Product
Name Unit Price
Inheritance of Attributes

• the attributes for POWER TOOLs are Product Number, Product Name,

Unit Price (all from PRODUCT), Weight (from TOOL), and Amperes.

• the attributes for NON-POWER TOOLs are Product Number, Product

Name, Unit Price, Weight, and Years of Warranty.


• the attributes for LIGHT FIXTUREs are Product Number, Product

Name, Unit Price, Number of Bulbs, and Watts Per Bulb.

• the attributes for LUMBER are Product Number, Product Name, Unit

Price, Type of Wood, and Dimensions.


Shows the addition of
some operations to the
diagram in Figure 9.2
(Figure 9.3)
Inheritance of Attributes

• three kinds of operations: constructor, query, and update, a

constructor operation creates a new instance of a class

• A query operation returns data about the values of an object’s

attributes but does not update them. Calculate Discount in the

PRODUCT class is an example of a query operation.


• An update operation updates an object’s attribute values. Change

Unit Price in the PRODUCT class is an example of an update

operation.

• Operations are inherited downwards in the same way that

attributes are

• Modification or refinement of operations as they are inherited

downwards is called polymorphism.


 AGGREGATION
• a class is shown to be composed of other classes

• the component classes can each have their own special attributes

and conceivably, operations, too


Shows the addition of
the FRAME and BULBS
classes, connected to
the LIGHT FIXTURE
class with a diamond-
shaped symbol

(Figure 9.4)
Figure 9.5 shows the complete
General Hardware Co. UML Class
Diagram. The upper portion of
the diagram is largely the
same as the entity-
relationship diagram of
Figure 9.1.
CUSTOMER
Customer Number
Customer Name
Street
City
State
Country
 
 
0
.
.
SALE * CREATION

Date Percent of
Price Responsibility
Quantity

The Good Reading Bookstores 1..*

Class Diagram PRODUCING


COMPANY PRODUCT CREATOR
Company Name
Figure 9.6, is the class-
Product Number Creator Number
Company Type Product Name Creator Type
City Year Created Creator Name
Country 1..* Year Born
diagram version of the Telephone Year
Founded
1 0..* 1..* Year Died

entity-relationship diagram
of Figure 2.10
BOOK PERIODICAL CD VIDEO/DVD

Pages Volume Number of Tracks Length


Number Length
Pages Chart Rating
Remove from Shelves 1 Update Chart
Add Book
Ratings
1

1..* 1..*
ARTICLE SONG
Ti Writer
tle Year
Author Written
Length
The World Music
Association Class Diagram
The upper portion of
Figure 9.7 is the class
diagram version of the
World Music Association
entity-relationship
diagram of Figure 2.11
The Lucky Rent-A-Vehicle Class
Diagram
The upper part of the Lucky class
diagram of Figure 9.8 looks very
much like the Lucky entity-
relationship diagram of
Figure 2.12.
The only difference is the change
from the CAR entity-type to the
VEHICLE class.
ENCAPSULATION
• A fascinating feature of object-oriented database management that

implements these ideas is called encapsulation.

• the attributes of a class’ or even an individual object are

‘‘encapsulated’’, stored together on the disk, with the operations

that will act upon them

• the program segments are actually stored within the database


Figure 9.9. The application
program sends along any input
data needed for the operation
(for example, the number of
years that an extended
warranty is to be in effect
for the Calculate Extended
Warranty Price for Power
Tools operation in General
Hardware’s POWER TOOL class
in Figure 9.5).
ABSTRACT DATA TYPES
OBJECT/RELATIONAL
DATABASE
SUMMARY
The relational database model is certainly powerful and has proven
to be highly resilient as the standard for data storage and
retrieval. However, for certain kinds of complex applications, the
relational model is lacking in support for certain useful data
model features. The object-oriented model fills this gap. The
object- oriented model provides support for more complex but
important relationships among different subcategories or
specialized categories of particular entities. This is known as
‘‘generalization’’ or ‘‘generalization/specialization.’’

You might also like