Implemetation of Object-Oriented Databases-Lec6
Implemetation of Object-Oriented Databases-Lec6
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
Applications
History of Databases
Implementation Issues
Relationships
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
Object Oriented Databases (ODBMS) store data together with the appropriate methods for
accessing it i.e. encapsulation.
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)
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
History of Databases
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.)
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
STUDENT
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
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)
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).
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 )
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
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.
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
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
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
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
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
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
14
http://www.dis.port.ac.uk/~chandler/OOLectures/database/database.htm (14 of 14) [10/13/2002 11:48:18 AM]