170 likes | 351 Views
OBJECT-ORIENTED DBMS. Structured & Object Oriented Approaches. Structured approach – long history, well-documented ERD - modeling data DFD - modeling process Tools – System Architect, Visible Analysis OO approach – new, offer benefits such as soft reuse Class Diagram - modeling data
E N D
Structured & Object Oriented Approaches • Structured approach – long history, well-documented • 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 studentsclass 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 Person Superclass (also known as base, parent or ancestor class) Student Lecturer Subclass (also known as child or derived class)
Person Superclass • Multilevel Class Hierarchy Student Employee Base class Full Time student Part Time Student Local employee 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.
Inherited attributes and methods Person Name Age Sex Initialize Add modify Derived Properties Name Age Sex Initialize Add modify Student Employee StudNo Course EmpNo Pay ChangeInfo 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
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