7 Chapter Seven
7 Chapter Seven
Object-Oriented DBMSs
Weaknesses of RDBMSs
• Semantic Overloading
– Relational model has only one construct for
representing data and data relationships: the
relation.
– Relational model is semantically overloaded.
2
Weaknesses of RDBMSs
3
Weaknesses of RDBMSs
• Limited Operations
– RDBMs only have a fixed set of operations
which cannot be extended.
4
Weaknesses of RDBMSs
• Impedance Mismatch
– Most DMLs lack computational completeness.
– To overcome this, SQL can be embedded in a
high-level 3GL.
– This produces an impedance mismatch -
mixing different programming paradigms.
– Estimated that as much as 30% of
programming effort and code space is
expended on this type of conversion.
5
Weaknesses of RDBMSs
6
What is an OODBMS ?
OODBMS (Object-oriented Database Management System): is a
database with data stored in objects and collections NOT rows and
tables.
Object Oriented Concepts:
OODBMS 7
OODBMS
OODBMS
OODBMS 9
Encapsulation & Information Hiding
Encapsulation: means that an object contains both data
structure and set of operations used to manipulate it.
OODBMS 11
Attributes
Attributes contain current state of an object:
OODBMS 12
Object Identity (OID)
Object identifier (OID) assigned to object when it is
created that is:
• System-generated.
• Unique to that object.
• Invariant (Stable).
• Independent of the values of its attributes (that is,
its state).
• Invisible to the user (ideally).
OODBMS 13
Object Identity (OID)
In RDBMS, entity identity is value-based: primary
key is used to provide uniqueness.
OODBMS 14
Methods & Messages
OODBMS 15
Object Showing Attributes & Methods
Method 1 Method 2
Attributes
Method 4 Method 3
OODBMS 16
Classes
OODBMS 17
Class Instance Share Attributes & Methods
BranchNo = B005
Street = 22 Deer Rd
City = London
Postcode = SW1 4EH
BRANCH
Attributes
branchNo BranchNo = B007
street Street = 16 Argyll St
city
postcode City = Aberdeen
Postcode = AB2 3SU
Methods
print()
getPostCode()
numberOfStaff() BranchNo = B003
Street = 163 Main St
City = Glasgow
Postcode = G11 9QX
OODBMS 18
Subclasses, Superclasses, &
Inheritance
Inheritance allows one class of objects to be defined as a
special case of a more general class.
•Special cases are subclasses and more general cases are
superclasses.
•Subclass inherits all properties of its superclass and can define its own
unique properties.
OODBMS 19
Subclasses, Superclasses, &
Inheritance
Types of inheritance: single, multiple, and repeated.
OODBMS 20
Overriding, Overloading &
Polymorphism
Overriding is the process of redefining a property within a
subclass.
OODBMS 21
Complex Objects
A Complex object is something that can be viewed as a single object
in the real world but it actually consists of many sub-objects.
OODBMS 22
Unified Modeling Language (UML)
OODBMS 25
Unified Modeling Language (UML)
PERSON
Name
FName
LName
OODBMS 26
Object Query Language (OQL)
Object Query Language OQL is a query language for
OODBMS.
• Does not provide explicit update operators - leaves this to
operations defined on object types.
OODBMS 27
Object Query Language (OQL)
OQL vs. SQL A Simple Example: List the names of the children of
employees working in the sales department.
OQL SQL
select select
c.fname, c.lname c.fname, c.lname
from from
Department d, d.Employee e, Department d, Employee e,
e.Children c Children c
where where
d.name = “Sales”; d.name = “Sales” and
d.deptID = e.deptID and
c.parentID = e.empID;
OODBMS 28
• Next chapter (Data Mining and Warehousing)
OODBMS 29