Sie sind auf Seite 1von 17

Object Database

System
By
Sudarshan

MCA Sem V 21/09/2007


RDBMS – a view point

• RDBMS “hammer the world flat” by


Normalisation.
• Representation in ‘Tables’
RDBMS – a view point

• RDBMS representation of a pet called


“cat’
OODBMS – a view point

• Wholesome ‘view’ of the object!!


RDMBS – the standard view

STUDENT
Student# StudentName Address
STUDIES
1 jane jones 6 The High Street
Student# Course#
2 brian brown 104 Park Avenue
1 C1
3 clara clarke 97 Gilmore Street
2 T2
4 sally smith 68 Lemon Grove
3 T2
5 tom taylor 53 London Road
4 Q9
COURSE 5F
Course# CourseName
C1 computing
F3 flower arranging
Q9 quantum mechanics
T2 theology
OODBMS – how it looks
RDBMS .. OODBMS

• SQL is used to ‘query’ a RDBMS.


– Operates over a Relational database
implemented as a ‘table’ or multiple ‘tables’
and produces a resultant ‘table’ containing
rows of entity sets
• OQL is used to query a ODBMS
– OQL statement will query an object
database and return a collection-object
which contains resultant objects
Example of OQL query

The following is a sample query


“what are the names of the black product?”

Select distinct p.name


From products p
Where p.color = “black”
⇒Valid in both SQL and OQL, but results are
different.
Result of the query (SQL)

Original table

Product no Name Color


P1 Ford Mustang Black
P2 Toyota Celica Green
P3 Mercedes SLK Black

Result
- The statement queries a relational
Name database.
Ford Mustang
=> Returns a table with rows.
Mercedes
SLK
Result of the query (OQL)

Original table

Product no Name Color


P1 Ford Mustang Black
P2 Toyota Celica Green
P3 Mercedes SLK Black

Result
- The statement
String String queries a object-
oriented database
Ford Mustang Mercedes SLK
=> Returns a
collection of objects.
OODB vs. RDB

OODB RDB
• Hierarchical • Relational
• Object Query • ANSI SQL
(OQL) • Two level storage
• Single level • Unique keys
storage • Foreign keys &
• Object ID Joins
• Reference
OODBs. vs. RDBs

• RDBs vs. OODBs.


– Difficult to compare as philosophically different.
– RDBs have only one construct i.e. Relation,
whereas the type system of OODBs is much richer
and complex.
– RDBs require primary keys and foreign keys for
implementing relationships, OODBs simply don’t.
– Optimization of queries in OODBs is much complex
than RDBs, but is mainly inspired from the
Optimization techniques in RDBs.
– OODBs support complex data whereas RDBs don’t.
– OODBs are much faster than RDBs but are less
mature to handle large volumes of data.
– There is more acceptance and domination of RDBs
in the market than that for OODBs.
ORDBs vs. RDBs

• RDBs vs. ORDBs


– An RDB does not support abstract data types
(ADT), all attribute values must be atomic and
relations must be in first normal form (flat
relation).
– An ORDB supports ADTs, attributes can be multi-
valued, and does not require first normal form.
– The underlying basic data structures of RDBs are
much simpler but less versatile than ORDBs.
– Optimization of queries is much easier and efficient
in RDBs compared to ORDBs. But this does not
mean that RDBs are faster than ORDBs.
– ORDBs support complex data whereas RDBs don’t.
OODBs vs. ORDBs.

• OODBs vs. ORDBs.


– Both support ADTs, collections, OIDs, and
inheritance, though philosophically quite different.
– ORDBs extended RDBs whereas OODBs add
persistence and database capabilities to OO
languages.
– Both support query languages for manipulating
collections and complex data.
– SQL3 is inspired from OO concepts and is
converging towards OQL (object query language).
– ORDBs carries all the benefits of RDBs, whereas
OODBs are less benefited from RDB technology.
– OODBs are seamlessly integrated with OOPLs with
less mismatch in the type systems;
Disadvantages of OODBMS

• No formal semantics, unlike the relational data


model.
• Pure OO systems do not include the notion of class
extents which is of fundamental importance in DB
management.
• Design methods must be evolved to include
behaviour and support for dynamic processes.
• Loss of the relational data model’s simplicity.
• Optimization / tuning(e.g. indexes) not as well
understood and are difficult; the overall record-at-a-
time flavour of the OO systems means that relational-
style optimization is unlikely.
• Transaction management support is not very mature.
OO Data Modelling: Example

• Case Study: UNN Information System (UNN-


IS)
– Northumbria University has several academic
departments.
– Each department provides one or more courses.
– Each course is composed of several modules, where a
module may be part of more than one course.
– A student enrolls on a course and every year takes a
specified number of modules. Note that several students
are usually registered for a course.
– Every student is assigned a tutor at the start of the
course, who is a lecturer in the department providing the
course.
– A lecturer works for a department and usually teaches on
several modules.
– Each module has a module tutor who is a lecturer. A
lecturer may be a tutor of several modules.

Das könnte Ihnen auch gefallen