0% found this document useful (0 votes)
42 views14 pages

Implemetation of Object-Oriented Databases-Lec6

The document provides an introduction to object-oriented databases (ODBMS). It discusses what an OODBMS is, including how it stores data together with methods for accessing it, encapsulating data within objects. It then summarizes the history of databases and how OODBMS work compared to relational databases. Key implementation issues for OODBMS like persistence, sharing, and paging are also outlined. The document concludes by describing the main types of relationships that can be modeled between objects in an OODBMS, such as inheritance, association, and aggregation.

Uploaded by

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

Implemetation of Object-Oriented Databases-Lec6

The document provides an introduction to object-oriented databases (ODBMS). It discusses what an OODBMS is, including how it stores data together with methods for accessing it, encapsulating data within objects. It then summarizes the history of databases and how OODBMS work compared to relational databases. Key implementation issues for OODBMS like persistence, sharing, and paging are also outlined. The document concludes by describing the main types of relationships that can be modeled between objects in an OODBMS, such as inheritance, association, and aggregation.

Uploaded by

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

Object Oriented Databases

INTRODUCTION TO OBJECT-ORIENTED
DATABASES

Sources include:
Chaudhri, A.B. (1993) Object Database Management Systems: An Overview in "BCS OOPS
Newsletter", No.18 Summer '93
Chaudhri, A.B. & Osmon, P. (1996) Databases for a New Generation in "Object Expert"
March/April '97 pp 33-38
Graham, I. (1994) Object Oriented Methods. Published by: Addison-Wesley, ISBN
0-201-59371-8
Graham, I. (1995) Migrating to Object Technology. Published by: Addison-Wesley, ISBN
0-201-59389-0
Vadarparty, K. (1996) Developing an ODBMS Application: Basic Steps in "Journal of Object
Oriented Programming" January '96 pp 19-21

What is an Object Oriented Database?

Applications

History of Databases

How do ODBMS Work?

Implementation Issues

Relationships

Benefits and Drawbacks of ODBMS

Examples of ODBMS

1
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (1 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases

What is an Object Oriented Database?

Back to the Beginning

Object Oriented Databases (ODBMS) store data together with the appropriate methods for
accessing it i.e. encapsulation.

Relational databases " hammer the world flat" by normalisation.

Relational database of a cat:

Object-oriented database of a cat:

2
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (2 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases

This enables:
o complex data types to be stored (e.g. CAD applications)

o a wide range of data types in the same database (e.g. multimedia applications)

o easier to follow objects through time (e.g. "evolutionary applications")

3
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (3 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases

Applications
Back to the Beginning

The first areas where ODBMS were widely used were:


CASE
CAD
CAM
Increasingly now used in:
telecommunications
healthcare
finance
multimedia
text/document/quality management
These are the 'next-generation applications" where traditional IT methods have often not impacted. For
example, it has been estimated that up to 90% of the data held in businesses is still paper-based, because a
large amount of data is not 'record oriented'.

http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (4 of 14) [10/13/2002 11:48:18 AM]


4
Object Oriented Databases

History of Databases

Back to the Beginning


file
store data after process created it has ceased to
systems exist
(1950s)

hierarchical/ concurrency
network
recovery
fast access
(1960s) complex structures
more reliability
relational less redundancy
(1970-80s)
more flexibility
multiple views
better simulation
more (and complex) data types
more relationships (e.g. aggregation, specialisation)
single language for database AND programming
ODBMS better versioning
no 'reconstruction' of objects
(1990s) other OO advantages (reuse, inheritance etc.)

How do ODBMS Work?


Relational Model
Object Model
Back to the Beginning

Example:

5
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (5 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases

Relational Model of Student-Course Relationship

STUDENT

Student# StudentName Address


1 jane jones 6 The High Street
2 brian brown 104 Park Avenue
3 clara clarke 97 Gilmore Street
4 sally smith 68 Lemon Grove
5 tom taylor 53 London Road

STUDIES

Student# Course#
1 C1
2 T2
3 T2
4 Q9
5 F3

COURSE
Course# CourseName
C1 computing
F3 flower arranging
Q9 quantum mechanics
T2 theology

To query:
"What course does Student 2 work in?"
go to STUDIES and look up Student 2 and return Course# (i.e. T2)

6
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (6 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases

go to COURSE and look up T2 and return Theology

"Name all students doing Theology"


go to COURSE and find Course# (i.e. T2)
go to STUDIES look up T2 and return all Student#s
go to STUDENT and find each Student# and return each StudentName

Object Model of Student-Course Relationship

OBJECT

To query:
"What course does Student 2 work in?"
search Students index for pointer to Student 2
follow CoursePointer to T2 and return CourseName (Theology)

"Name all students doing Theology"


search Course Index and find Course# (i.e. T2)
follow Student Pointers, looking up each Student#
This process is called navigation, note that it relies heavily on pointers and that a large proportion of pointers must
be persistent.

7
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (7 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases

Implementation Issues
Persistence
Sharing
Paging
Back to the Beginning
1. Object-oriented databases give objects persistence, which enables objects to be stored between
database runs. (NOTE: in the context of ODBMS, PERSISTENCE = POST RUN TIME
PERSISTENCE), this facilitates versioning (i.e. a new, additional object is stored each time changes
are made).

2. Object-oriented databases allow objects to be shared between processes in a distributed environment.

8
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (8 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases

3. Object-oriented databases can reduce the need for paging by enabling only the currently required
objects to be loaded into memory (relational databases load in tables containing both the required
data AND other unnecessary data )

ODBMS Relational DBMS

9
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (9 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases

Relationships
Inheritance
Association
Aggregation
Inverse or Parent
Back to the Beginning
Object-oriented databases model four standard relationships between the objects they contain:

1. Inheritance
i.e. an object is a kind of something else

2. Association

i.e. an object has a connection with another object eats

3.Aggregation
i.e. an object is made up of other objects

10
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (10 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases
____________________ BUTTERFLY ______________
| / \ |
LEFT WING RIGHT WING ANTENNAE BODY/HEAD

This is the 'usual' view - a butterfly object knows what parts it is made up of.

4. Inverse (or Parent) relationship

i.e. an object is part of another object


is_part_of

Here we are saying explicitly that the wing 'knows' it is a part of the butterfly, but the butterfly does not
necessarily know it is made up of wings.

Benefits and Drawbacks of ODBMS


Benefits
Drawbacks
Back to the Beginning

Benefits

1. the objects do not require re-assembling from their component tables each time they are used
thereby reducing processing overheads by increasing access speeds e.g. up to 100 times faster for some
applications (Sun Cattel benchmark)

2. Paging is reduced

11
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (11 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases

3. Versioning is easier

4. Navigation through the database is easier and more natural, with objects able to contain pointers
to other objects within the database

5. Reuse reduces development costs

6. Concurrency control is simplified by the ability to place a single lock on an entire hierarchy
(while still retaining the choice to lock individual objects)

7. Better data model as based on the 'real world' instead of the 'flattened' relational model

8. Good for applications where the relationships between items in the database carry key
information e.g. in the student database, we were particularly interested in what students studied (i.e. the
STUDIES relationship). This is handled very efficiently by navigation.

9. Relationships and constraints on objects can be stored in the server application rather than the
client application therefore any changes need only be made in one place thus reducing the need for and risks
involved in making multiple changes

10. Fit in well with client/server and distributed architectures

Drawbacks

1. Poor for applications where the values of items in the database carry key information e.g. if we
had been more interested in student age (e.g. to calculate the mean age) than the courses they study then
relational database would clearly be more efficient

2. Speed of access may be reduced by late binding which may cause extensive searches through the
inheritance hierarchies

3. Present lack of standards including the lack of a common query language such as SQL (though
OQL on its way?)

4. There are as yet no formal semantics for ODBMS. Relational databases can be 'proved' correct
by means of set theory and relational calculus

5. The simplicity of relational tables is lost

12
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (12 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases

6. The object oriented paradigm shift can make the move to ODBMS difficult

Examples of ODBMS
Back to the Beginning
1. Many pure ODBMS are available
2. Also there is a whole group of hybrid Relational/Object DBMS.

DATABASE ENGINE
Relational Object
Oracle Illustra
Relational Data
Model Ingres UniSQL/X
*1
Ontos
ITASCA
OpenODB Versant
Odaptor ObjectStore
Object Data
Persistence Objectivity
Model
O2
*2 Gemstone
Objectory/DB
*3

*1 These are traditional relational databases but new/projected versions have object-oriented 'add-ons' e.g.
Ingres Version 6 (OpenIngres) Oracle Version 8

*2 Different ways to achieve this: Object Mediator (Persistence) - maps objects to relations, Object
Wrapper (OpenODB) - object server sits on relational database, Odaptor like OpenODB but sits on Oracle

*3 Different 'OOP language dependencies': ObjectStore/Objectivity - based on C++ with Smalltalk support;
Gemstone - based on Smalltalk with C++ support; O2/ITASCA - language neutral, with several language
support

Back to the Beginning

Steve Hand and Jane Chandler


26th February 1998

13
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (13 of 14) [10/13/2002 11:48:18 AM]
Object Oriented Databases

This Page is maintained by Jane Chandler


Email: [email protected]
Page last updated: 3rd September 1998

14
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (14 of 14) [10/13/2002 11:48:18 AM]

You might also like