object-oriented database management systems

50
Object-Oriented Database Management Systems The goal of all inanimate objects is to resist man and ultimately to defeat him Russell Baker, 1968

Upload: teague

Post on 13-Jan-2016

106 views

Category:

Documents


2 download

DESCRIPTION

Object-Oriented Database Management Systems. The goal of all inanimate objects is to resist man and ultimately to defeat him Russell Baker, 1968. Content. Object orientation why and what Object oriented modeling OO vs RDB. Shortcomings of relational model. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Object-Oriented Database Management Systems

Object-Oriented Database

Management Systems

The goal of all inanimate objects is to resist man and ultimately to defeat

himRussell Baker, 1968

Page 2: Object-Oriented Database Management Systems

Content

Object orientation why and whatObject oriented modelingOO vs RDB

Page 3: Object-Oriented Database Management Systems

Shortcomings of relational model

It cannot handle complex objects such as multimediaThere is no support for general data typesPerformance degrades when large numbers of tables must be joinedThere is a mismatch between the relational data model’s set-at-a-time processing and the record-at-a-time processing of programming languagesThere is no support for representing and recording change, such as different versions of objects

Page 4: Object-Oriented Database Management Systems

UML

Unified modeling languageIntroduced in 1997Common modeling language for OO software development

Page 5: Object-Oriented Database Management Systems

OO and IS management

The goal of IS management is to deliver projects:

On timeOn budgetFully functional

OO technology offers an opportunity to meet these goals

Page 6: Object-Oriented Database Management Systems

Why OO and ODBMS?

Procedural languages and relational databases are not designed to handle complex data such as

MultimediaCAD/CAMEconomic modelsDocument management systemsComplex data structures

Page 7: Object-Oriented Database Management Systems

Historical development

The first OOPL was developed in Norway in the mid 60s (SIMULA)Smalltalk appeared in the 70sJava and COBOL support OO conceptsOOPLs are well suited for GUI applications

Page 8: Object-Oriented Database Management Systems

Data and OO modeling

Data Modeling Term OO Modeling Term

Entity Object class or classes

Instance Object

Attribute Attribute

Page 9: Object-Oriented Database Management Systems

Key concepts

Data abstractionObject instances and classesEncapsulationMessage passingGeneralization/specialization hierarchiesInheritanceReuse

Page 10: Object-Oriented Database Management Systems

Data Abstraction

Abstract model of realityEssential elements of relationships

Page 11: Object-Oriented Database Management Systems

Object instances and classes

Object instanceSingle representations

Object classesA collection of objects of the same typee.g., SHARESimilar concept to an entity

Object identification (OID)Unique reference to an object instance

Page 12: Object-Oriented Database Management Systems

Encapsulation

A central conceptAll the processing is done within the objectAn object is shielded from interference by other objects

Page 13: Object-Oriented Database Management Systems

Message passing

Objects communicate by sending and receiving messagesThe receiving object needs a method for handling the messageA message can trigger a change in a receiving object

Page 14: Object-Oriented Database Management Systems

Generalization/specialization hierarchies

Classes can be generalizations or specializations of other classesACADEMIC PERSON is a generalization of subclasses student and staffSTUDENT is a specialization of superclass ACADEMIC PERSON

Page 15: Object-Oriented Database Management Systems

Inheritance

A subclass can inherit the data and methods of its superclassSimplifies programmingCreates reusable objects

Page 16: Object-Oriented Database Management Systems

Reuse

Reusable code has been a persistent goal of IS managersObjects are building blocks for assembling new applicationsA major means of increasing programmer productivity

Page 17: Object-Oriented Database Management Systems

Key concepts

Data abstractionObject instances and classesEncapsulationMessage passingGeneralization/specialization hierarchiesInheritanceReuse

Page 18: Object-Oriented Database Management Systems

Why OO?

Reducing the application backlogOvercoming the slow growth in programmer productivityReducing maintenance problems

Page 19: Object-Oriented Database Management Systems

Reducing maintenance

Objects are relatively independent so there is less ripple effectOO concepts are closer to the way clients think so there are less specification errorsPrototyping is easyObjects are easily modified

Page 20: Object-Oriented Database Management Systems

OO Concepts

Page 21: Object-Oriented Database Management Systems

Objects and IS modeling

A model is an abstraction of the real world

e.g., a map

A model should reduce the communication gap between the client and analyst

Match the way the client thinksHelp capture client’s needs

Page 22: Object-Oriented Database Management Systems

Types of models

Data and proceduresStatic and dynamic

Static• Class diagram• What the system can remember and do

Dynamic• What the system does

Page 23: Object-Oriented Database Management Systems

Finding objects and classes

Observe and listenLook for structures

Page 24: Object-Oriented Database Management Systems

Layers of an OO model

Class and object layerStructure layerAttribute layerService layer

Page 25: Object-Oriented Database Management Systems

Object layer

Identifying objects and classesUnderline the nouns in the problem description Customers can rent diving equipment and

boats from DDT. When a customer has seen what is available and decided what to rent, a rental agreement or contract is produced and signed

Page 26: Object-Oriented Database Management Systems

Structure layer

Generalization/specializationWhole/part

Page 27: Object-Oriented Database Management Systems

Generalization/specialization

The attributes and methods established for RENTAL EQUIPMENT are inherited by the classes DIVING EQUIPMENT and BOAT

Page 28: Object-Oriented Database Management Systems

Abstract classes

Only diving equipment and boats are rentedRENTAL EQUIPMENT does not contain objects

RENTAL EQUIPMENT is an abstract class

Page 29: Object-Oriented Database Management Systems

Generalization/specialization

SUIT is a ‘kind of’ DIVING EQUIPMENTSUIT inherits the attributes and methods of DIVING EQUIPMENT

Page 30: Object-Oriented Database Management Systems

Multiple inheritance

A class can inherit attributes and methods from multiple superclassesNot supported by all OOPLs because of possible conflicts

Page 31: Object-Oriented Database Management Systems

Whole/part structures

A composition or aggregationTRAILER ‘is part of’ BOAT ASSEMBLYDistinguished by the diamond

Page 32: Object-Oriented Database Management Systems

Object model – take 1

Page 33: Object-Oriented Database Management Systems

Attribute layer

Specification of attributesSpecification of association relationshipsSpecification is similar to data modeling

Page 34: Object-Oriented Database Management Systems

Association relationships

Depict links between actual object occurrences

Page 35: Object-Oriented Database Management Systems

Association relationships

Can also depict an aggregation relationship

A special version of an association relationshipItems in a contract are part of a contract

Page 36: Object-Oriented Database Management Systems

Object model - final version

Page 37: Object-Oriented Database Management Systems

Service layer

Describes processing for each specified objectSimple services

Standard services all objects are expected to performImplicit and not shown

ComplexNon-standard servicesShown explicitly

Page 38: Object-Oriented Database Management Systems

OO and relational paradigms

OO paradigm Relational paradigm

Based on software engineering principles of coupling, cohesion, and encapsulation

Founded on the mathematical concepts of set theory

The goal is to improve the quality of systems, and there is concern for both data and processes

The goal is to improve data management

To access data you traverse objects via relationships

To access data you match primary and foreign keys

Coupling is a measure of how cleanly the modules in a system are separated from one another.Cohesion is the measure of the strength of functional relatedness of elements within a module.

Page 39: Object-Oriented Database Management Systems

Mapping

Each attribute is mapped to zero or more columns

An attribute that is stored in the database is a persistent attribute.Non-persistent (i.e., derived) attributes are not mappedSome attributes need to be broken into components

Page 40: Object-Oriented Database Management Systems

MappingGeneralization

Vertical• Each class is mapped to a separate table• Recommended

Horizontal• Each subclass is mapped to a different table• The superclass is not mapped to a table

Filtered• All classes are mapped to the same table• The table contains columns for all attributes in

both classes with a column added to distinguish between the subclasses.

Page 41: Object-Oriented Database Management Systems

MappingAssociation and aggregation

Associations are mapped like their corresponding data model parallels• e.g., an m:m association is mapped by

creating an associative entity

Physically, an aggregation might be implemented using clustering or a linked list because the whole and parts are often retrieved together

Page 42: Object-Oriented Database Management Systems

The role of the ODBMS

Objects have a life that extends beyond the execution of the OO programPersistent objects live longer than the methods that create themAn ODBMS stores data when the OO application is not running

Page 43: Object-Oriented Database Management Systems

Types of persistence

Short livedExists only during the life of the method

Long livedObjects remain stored until the database is deletedThe purpose of an ODBMS is to store long lived objects

Page 44: Object-Oriented Database Management Systems

Features of an ODBMS

An ODBMS supports OO conceptscomplex objectsabstract data typesencapsulationinheritance

An ODBMS also providesdata sharingconcurrent data accessrecovery control

Page 45: Object-Oriented Database Management Systems

Overcoming the impedance mismatch

problemThere is a difference between set-at-a-time processing of a RDBMS and record-at-a-time processing of procedural programming languagesSome procedural languages do not handle RDBMS data types and arithmetic (e.g., dates)OO programming languages and ODBMSs fit together more closely than RDBMSs and procedural languages

All operations are at the record level

Page 46: Object-Oriented Database Management Systems

The Object Database Standard

The OMG (Object Management Group) is creating and promulgating a standard for OO technologyThe goal is to minimize incompatibility across platforms and standardize some featuresOMG has released an Object Database Standard

Page 47: Object-Oriented Database Management Systems

ODBMS versus RDBMS

Support for storage and manipulation of complex objectsRaised the level of abstraction by introducing classes and inheritanceOvercomes the impedance mismatchSet level processing with SQL makes ad hoc querying easier than record-at-a-time processing

Page 48: Object-Oriented Database Management Systems

Directions

Pure object databaseHybrid object-relational

Favored path

Interest in OO appears to have peaked

Two major vendors compared income:RDBMS: Oracle : $10 100 000 000 ODBMS: Versant : $22 000 000

Page 49: Object-Oriented Database Management Systems

Hybrid Technology

Object-relational databasesExtended-relational systemsSQL-99 standardizes OO extensions to RDB

Vendors do not follow the standardUniversal serversUser-defined datatypes

Distinct datatypes• Simple datatypes that extend the basic datatypes

Abstract datatypes• Complex datatypes with internal structures and

attributes• geospatial or time-series data

Page 50: Object-Oriented Database Management Systems

The future

RDBMSNon-complex object storesIncorporate OO concepts without compromising the relational modelOO systems can use RDB for persistence via object-relational frameworks, for example: Hibernate

ODBMSComplex object storesIncorporate relational concepts without losing advantages of OO concepts

A hybrid object-relational model