-
8/3/2019 Object Orientated Database Management Systems
1/24
Object Orientated DatabaseManagement Systems
Team Nutmeg V2 Bock Yang
-
8/3/2019 Object Orientated Database Management Systems
2/24
What is RDBMS?
Relational Database ManagementSystem(RDBMS)
RDBMS requires tabular structure fordata
RDBMS is designed to take care oflarge amounts of data and secure itunlike DBMS
-
8/3/2019 Object Orientated Database Management Systems
3/24
Reasons for Unsuitability ofRDBMS Poor Representation of "Real World"
Entities
Normalization leads to relations that does
not correspond to entities in real world. Semantic Overloading
Relational model has only one construct
for representing data and datarelationships: the relation
-
8/3/2019 Object Orientated Database Management Systems
4/24
Reasons for Unsuitability ofRDBMS Poor support for Integrity and
Enterprise Constraints
Homogeneous Data Structure Relational model assumes both horizontal
and vertical homogeneity
RDBMS has limited operations whichonly have a fixed set of operations thatcannot be extended
-
8/3/2019 Object Orientated Database Management Systems
5/24
Reasons for Unsuitability ofRDBMS Difficulty handling of Recursive
Queries
Recursive queries are queries about
relationships that a relation has with itself(directly or indirectly)
Extension proposed to relational
algebra to handle this type of query isrecursive closure operation (i.e. tuplesare transitively deduced)
-
8/3/2019 Object Orientated Database Management Systems
6/24
Recursive Example
SELECT managerstaffNo
FROM Staff
WHERE staffNo=S005
UNION
SELECT managerstaffNo
FROM Staff
WHERE staffNo=
(SELECT managerstaffNo
FROM Staff
WHERE staffNo=S005)
-
8/3/2019 Object Orientated Database Management Systems
7/24
Reasons for Unsuitability ofRDBMS Other Problems with RDBMS
Transactions are generally short-lived andconcurrency control protocols not suited
for long-lived transactions
Schema changes are difficult
RDBMS are poor at navigational access
-
8/3/2019 Object Orientated Database Management Systems
8/24
OO Concepts
Abstraction, encapsulation,information hiding.
Objects and attributes.
Object identity. Methods and messages.
Classes, subclasses, superclasses,
and inheritance. Overloading.
Polymorphism and dynamic binding.
-
8/3/2019 Object Orientated Database Management Systems
9/24
Abstraction
Denotes extracting of essential detailsabout items or a group of items whileignoring the inessential details.
Focus on attributes of an object beforedeciding on the implementation
methods.
-
8/3/2019 Object Orientated Database Management Systems
10/24
Encapsulation and InformationHiding*Note: Encapsulation is not informationhiding
Encapsulation: TO enclose related
operations and data related to anobject into that object
Information Hiding: Hiding certain
details which will not affect other partsof the system.
-
8/3/2019 Object Orientated Database Management Systems
11/24
Object
Superkey identifiable entity that haveboth attributes and actions associatedwith it.
-
8/3/2019 Object Orientated Database Management Systems
12/24
Attributes
Contains current state of an object
Classified into simple or complex
Simple attributes can be primitive type
such as integer, string, etc.
Complex attributes contain collectionsor references
-
8/3/2019 Object Orientated Database Management Systems
13/24
Object Identity
Object Identifier must be
System-generated
Unique
Invariant
Independent of the values of itsattributes
Invisible to user
-
8/3/2019 Object Orientated Database Management Systems
14/24
Mapping object into RDBMS
Requires mapping class instances toone or more tuples with distributedrelations
Have to handle 2 basic class hierarchytasks
1. Design relations to represent hierarchy
2. Design how objects will be accessed
-
8/3/2019 Object Orientated Database Management Systems
15/24
Object Identity -Implementation In RDBMS, object identity is value-
based: primary key is used to provideuniqueness.
Primary keys do not provide type ofobject identity required in OOsystems:
key only unique within a relation, notacross entire system
Key generally chosen from attributes ofrelation, making It dependent on object
state
-
8/3/2019 Object Orientated Database Management Systems
16/24
Methods and Messages
Method Defines behaviour of an object, as set of
encapsulated functions
Message
Request from one object to another
asking secondary object to execute one ofits methods.
-
8/3/2019 Object Orientated Database Management Systems
17/24
Object Showing Attributes andMethods
-
8/3/2019 Object Orientated Database Management Systems
18/24
Example of a Method
-
8/3/2019 Object Orientated Database Management Systems
19/24
Class
Blueprint for defining a set of similarobjects.
Objects in a class are called
instances. Class is also an object with own class
attributes and class methods.
Class different from type
-
8/3/2019 Object Orientated Database Management Systems
20/24
Class Instance Share Attributesand Methods
-
8/3/2019 Object Orientated Database Management Systems
21/24
Mapping Classes to Relations
Example
-
8/3/2019 Object Orientated Database Management Systems
22/24
Mapping Classes to Relations
(1) Map each class or subclass to arelation:
Lecturer(StaffID, homeNO,ExtensionNO, position, gender)
Course Manager(StaffID, course,
lecturers)Course Coordinator(StaffID, students)
Subject Manager(StaffID, Subject, labs)
-
8/3/2019 Object Orientated Database Management Systems
23/24
Mapping Classes to Relations
(2) Map each subclass to a relation
Course Manager(StaffID, homeNO,
ExtensionNO, position, gender, course,lecturers)
Course Coordinator(StaffID, homeNO,ExtensionNO, position, gender ,students)
Subject Manager(StaffID, homeNO,ExtensionNO, position, gender, Subject, labs)
-
8/3/2019 Object Orientated Database Management Systems
24/24
Mapping Classes to Relations
(3) Map the hierarchy to a singlerelation
Lecturer(StaffID, homeNO, ExtensionNO,position, gender ,course, lecturers ,students ,subject, labs)