object oriented databases - home pages of [email protected]/~ssirpal/presentations/session 9...

58
1 Object Oriented Databases Database Systems: Design, Implementation, and Management, Seema Sirpal Delhi University Computer Centre

Upload: doliem

Post on 05-Apr-2019

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

1

Object Oriented Databases

Database Systems:

Design, Implementation, and Management,

Seema Sirpal

Delhi University Computer Centre

Page 2: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

2 2

You will learn:

� What basic concepts govern OO systems

� How OO features are related to the more traditional

relational and ER models

� What the basic features of an OO database management system (OODBMS) are

� What effect OO concepts are likely to have on data modeling and design

Page 3: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

3 3

You will learn: (continued)

� About the advantages and disadvantages of

OODBMSs

� How OO concepts have influenced the

relational model

� How Oracle9i implements object extensions

Page 4: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

4 4

Object Orientation and Its Benefits

� 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 act upon itself and interact

with other objects

� Modularity is therefore almost inevitable

Page 5: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

5 5

Object Orientation Contributions

Page 6: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

6 6

Key Benefits of Object Technology

• Easy maintenance of applications

• Saves money on maintenance

• Faster product development

• Gives company a competitive advantage

• Higher quality of code at a lower cost

• Leads to more satisfied customers

• Reusability of code

• Allows multiple programmers to share a code repository, which saves

time and money

Page 7: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

7 7

The Evolution of Object Oriented Concepts

� Object oriented programming

– Developed as an alternative to traditional programming methods

– Programmer creates or uses objects:

� Self-contained, reusable modules that contain data as well as the procedures used to operate on such data

Page 8: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

8 8

The Evolution of Object Oriented Concepts (continued)

� Object oriented programming languageswere developed to:– Provide an easy-to-use software development

environment

– Provide a powerful software modeling tool for application development

– Decrease development time by reducing the amount of code

– Improve programmer productivity by making that code reusable

Page 9: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

9 9

The Evolution of Object Oriented Concepts (continued)

� Object oriented environment has several

important attributes:

– Data set is no longer passive

– Data and procedures are bound together, creating

an object

– Object has an innate ability to act on itself

Page 10: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

10 10

Object Oriented Concepts

� Have their roots in programming languages

� No knowledge of programming is necessary

to understand these concepts

Page 11: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

11 11

Objects: Components and Characteristics

� Object:

– Abstract representation of a real-world entity

– Has:

� Unique identity

� Embedded properties

� Ability to interact with other objects and act upon itself

– Defining characteristic is its unique identity

Page 12: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

12 12

Real-World Student Objects

Page 13: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

13 13

Object Identity

� Unique to that object

� Assigned by system at moment of object’s creation

� Cannot be changed under any circumstances

� Can be deleted only if the object is deleted

� Can never be reused

Page 14: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

14 14

Object Attributes

Page 15: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

15 15

Methods

� Method:

– Code that performs a specific operation on object’s data

– Protects data from direct and unauthorized access by other objects

– Used to change the object’s attribute values or to return the value of selected object attributes

– Represent real-world actions

Page 16: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

16 16

Depiction of an Object

Page 17: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

17 17

Method Components

Page 18: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

18 18

Objects Send Messages to Each Other

Page 19: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

19 19

Classes

� Collection of similar objects with shared

structure (attributes) and behavior (methods)

� Class instance or object instance

– Each object in a class

Page 20: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

20 20

Class Illustration

Page 21: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

21 21

Musical Instruments Class Hierarchy

Page 22: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

22 22

Single Inheritance

Page 23: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

23 23

Multiple Inheritance

Page 24: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

24 24

Motor Vehicle and Bicycle Instance Variables

Page 25: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

25 25

Employee Class Hierarchy Method Override

Page 26: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

26 26

Employee Class Hierarchy Polymorphism

Page 27: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

27 27

Characteristics of an Object Oriented Data Model

� Support the representation of complex objects

� Are extensible:– Capable of defining new data types as well as

the operations to be performed on them

� Support encapsulation:– Data representation and method’s

implementation must be hidden from external entities

Page 28: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

28 28

Characteristics of an Object Oriented Data Model (continued)

� Exhibit inheritance:

– Object must be able to inherit properties (data

and methods) of other objects

� Support the notion of object identity (OID)

Page 29: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

29 29

Comparing the OO and ER Model Components

Page 30: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

30 30

Shared Representation for All Objects of the Class Person

Page 31: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

31 31

State of a Person Object Instance

Page 32: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

32 32

Defining Three Abstract Data Types

Page 33: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

33 33

Object Representation for Instances of the Class Person with ADTs

Page 34: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

34 34

Object State for an Instance of the Class Person, Using ADTs

Page 35: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

35 35

Referential Object Sharing

Page 36: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

36 36

Class Hierarchy

Page 37: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

37 37

Employee Object Representation

Page 38: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

38 38

Class Hierarchy for the Retail Corporation

Page 39: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

39 39

Representing a 1:M Relationship

Page 40: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

40 40

Representing 1:1 and 1:M Relationships

Page 41: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

41 41

Employee-Dependent Relationship

Page 42: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

42 42

Representing the M:N Relationship

Page 43: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

43 43

INVENTORY Table with Predetermined (Base) Data Types

Page 44: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

44 44

Inventory Class with Early Binding

Page 45: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

45 45

OODM Inventory Class with Late Binding

Page 46: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

46 46

OODM and Previous Data Models: Similarities and Differences

� OODM object resembles entity and tuple in the ER and relational models but has additional characteristics

� Class

� Hierarchies

� Encapsulation

� Relationships

� OODM produces a schema in which relations form part of the structure of the database

Page 47: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

47 47

An Invoice Representation

Page 48: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

48 48

Object Oriented Database Management Systems

� Integrate benefits of typical database

systems with the more powerful modeling

and computational (programming)

characteristics of the object oriented data

model

� Used to develop complex systems

Page 49: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

49 49

Object Oriented Database Management Systems

� Result of combining OO features, such as– class inheritance– encapsulation, and

– polymorphism,

� With database features such as– data integrity, -- data manipulation,– security, -- system tuning and– persistence, -- recovery– transaction management, – concurrency control, – backup,

Page 50: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

50 50

Object Oriented Database Management Systems

Page 51: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

51 51

The Thirteen OODBMS Rules

Page 52: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

52 52

How Object Orientation Affects Database Design

� Relational and ER models sometimes cannot adequately represent some objects

� Operations are not a part of the database model

� Object oriented design requires the database description to include objects and their data representation, constraints, and operations

� Few computerized OODB design tools exist

� Lack of standards affects object oriented database design

Page 53: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

53 53

OODBMS:Advantages and Disadvantages

� OODBMS occupies a strong market

� Vehicle for technological innovation

� Has not been the beneficiary of market share

growth

Page 54: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

54 54

How OO Concepts Have Influenced the Relational Model

� RDBMS is beginning to reach its limits in a

business data environment that is changing

with the advent of mixed-media data storage

and retrieval

Page 55: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

55 55

How OO Concepts Have Influenced the Relational Model

� Extended relational model (ERM), or object/relational model (O/RM)

– Extensibility of new user-defined (abstract) data types

– Complex objects

– Inheritance

– Procedure calls (rules or triggers)

– System-generated identifiers (OID surrogates)

Page 56: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

56 56

The Next Generation of Database Management Systems

� Likely to incorporate features borrowed from object oriented database systems, artificial intelligence

systems, expert systems, distributed databases, and

the Internet

� Enable future DBMSs to handle more complex

problems with both normalized and nonnormalizeddata

� OODBMS will probably continue to occupy a niche within the database market

Page 57: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

57 57

Summary

� Object oriented concepts are derived from OO programming languages

� An object is a conceptual representation of a real-world entity

� Similar objects are grouped in classes

� Classes are organized into a class hierarchy

� Abstract data types are implemented through classes

� The OO data model allows the designer to create a

more authentic representation of real-world objects

Page 58: Object Oriented Databases - Home Pages of People@DUpeople.du.ac.in/~ssirpal/presentations/Session 9 - Object... · Object Oriented Database Management Systems Integrate benefits of

58 58

Summary (continued)

� OODBMSs combine OO features with database features

� OODBMSs yield several benefits over conventional DBMSs

– more semantic information in the database

– support for complex objects

– better performance in complex applications

– reusability of classes

– extensibility of the data types supported by the database