OBJECT-ORIENTED DBMS

advertisement
OBJECT-ORIENTED DBMS
Structured & Object Oriented Approaches
 Structured approach – long history, welldocumented
ERD - modeling data
DFD - modeling process
Tools – System Architect, Visible Analysis
 OO approach – new, offer benefits such as soft
reuse
Class Diagram - modeling data
USE-Case diagram - system functionalities
Tools – Rational Rose
OO Concepts
Classes
Class is a group of objects that have similar
attributes (properties) and behavior
All objects in class have similar attributes and
they perform similar operations
E.g. all pupils in a students class will have the
same attributes (not attribute values) such as
name and address.
An object is a structure that encapsulates
(or packages) both data and methods.
The data (also called properties) describes the
attributes of the object while methods (also
called operations, services, functions or
procedures) describe its behavior.
An Object with Attributes and Methods
Employee
Object’s
Name
EmpNo
EmpName
Pay
Object’s
Attribute
ModifyInfo
ComputePay
Object’s
Method
Encapsulation
Encapsulation means packaging both the
data object’s and method together
Only methods within an object are allowed
to modify the object’s attribute (data).
The data and details of the methods of an
object are hidden from other object’s data
and methods – i.e. the external methods
(belonging to other objects) cannot modify
other object’s attribute.
Class Hierarchy
Superclass (also
known as base,
parent or ancestor
class)
Person
Student
Lecturer
Subclass (also
known as child or
derived class)
Multilevel Class Hierarchy
Superclass
Person
Student
Full Time
student
Part Time
Student
Employee
Local
employee
Base class
Foreign
employee
Base class
Inheritance
Inheritance is the property that when
classes are arranged in a hierarchy, a
derived class can inherit (automatically)
the properties ( attributes) and behaviors
(methods) of its parent or base class.
e.g.
Class
Attributes
Methods
Person
Name, Age, sex Initialize, Add ,
Modify
Student
StudNo, Course ChangeInfo
Employee
EmpNo, Pay
ComputePay
Inherited attributes and methods
Person
Name
Age
Sex
Initialize
Add
modify
Derived Properties
Student
StudNo
Course
ChangeInfo
Name
Age
Sex
Initialize
Add
modify
Employee
EmpNo
Pay
ComputePay
OO Databases
In OO data management (OODM) , each
object in the system has an identity that is
internal to the data stored within the object
There is no concept of primary key
OODBMS maintains an external identifier
for each object, which is not accessible to
any object, function or application
The identity of the object does not change
Types of Methods
Types
Description
Occur Methods These methods provide basic maintenance functions
for class instances and classification structure .
There are 4 Occur Methods:
Add – add instance of object
Change – change the property of the object’s
instances
Delete – delete an object’s instances
Select – Select an object
Calculate
Methods
Perform calculation on data within an object (can be
simple or complex)
Monitor
Methods
Used to monitor system’s characteristics such as
when the stock level of a product reaches a specified
value.
Advantages of OODBMS
Enriched modeling capabilities – closely
model the real world object
Extensibility – allows to develop new
abstract data types using existing data
types
More expressive query
Suitable for advance DB applications
Disadvantages of OODBMS
Lack of experience
Lack of standards
Lack of view mechanism
Inadequate security
Despite of its capability, OODBMS did not
gain so much popularity and not widely
accepted.
Reasons why organizations are reluctant
to use OODBMS :
Existing investment
High switching cost
Using two methodologies in the same
organization can be expensive
Staff training cost
THE END
Download