UNIT - 1
Introduction to Object-Oriented Database Systems
Object Orientation
• Object Orientation
• Set of design and development principles
• Based on autonomous computer structures known as objects
• OO Contribution areas
• Programming Languages
• Graphical User Interfaces
• Databases
• Design
• Operating Systems
Evolution of OO Concepts
• Concepts stem from object-oriented programming languages (OOPLs)
• Ada, ALGOL, LISP, SIMULA
• OOPLs goals
• Easy-to-use development environment
• Powerful modeling tools for development
• Decrease in development time
• Make reusable code
• OO Attributes
• Data set not passive
• Data and procedures bound together
• Objects can act on itself
Advanced Database Applications
The application of database is being highly practiced in complex applications demanding
different way of modeling and designing. Some of these applications are:
• Computer Aided Design (CAD)
• Computer Aided Manufacturing
• Computer Aided Software Engineering
• Network Management System
• Multimedia System
• Digital Publication
• Geographic Information System
• Interactive and Dynamic Web Sites
Drawbacks/Weaknesses of Relational DBMS
In addition to the emergence of many advanced database application areas, there were some
drawbacks on the relational database management system.
1. Poor representation of ‘real world’ entities
relations does not correspond to real world objects
2. Semantic overloading (semantically Overloaded)
Representation of complex relationship is difficult
Eg. M:N relationship is represented by adding one additional relation
(making the relation an entity)
One cannot distinguish a relation from a relationship.
Difficult to distinguish different types of relationship.
3. Poor support for integrity and enterprise constraints
Many commercial DBMS do not support all integrity constraints
The relational model do not support enterprise constraints it has to be done
on the DBMS
4. Homogeneous data structure
Has vertical and horizontal homogeneity
Horizontal Homogeneity: Each tuple of a relation have same number and type
of attributes
Vertical Homogeneity: Values of an attribute should come from same domain.
Field value should be atomic
5. Limited operations
Relational model has fixed operations on the data
Does not allow additional/new operations
6. Difficulty in handling recursive queries
Direct and indirect recursive queries of a single relation can not be
represented.
Query to extract information from recursive relationship between tuples of
same entity is difficult to represent.
7. Impedance mismatch
Mixing of different programming paradigms
Mismatch between the languages used
8. Poor navigational process
Access is based on navigating individual records from different relations
OO Concepts
• Object is a uniquely identifiable entity that contains both the attributes that describes the
state of the ‘real world’ object and the action that are associated with it.
• OODBMS can manage complex, highly interrelated information.
• Abstract representation of a real-world entity
• Unique identity
• Embedded properties
• Ability to interact with other objects and self
OID (Object Identity)
• Each object is unique in OO systems
• Unique to object
• Not a primary key (PK is unique only for a relation, PK is selected from attribute
making it dependent on the state)
• Is invariant (will not change)
• Independent of values of attributes ( two objects can have same state but will have
different OID)
• Is invisible to users
• Entity integrity is enforced
• Relationship: embedding the OID of one object into the other ( embed OID for a
branch to employee object)
• Advantage of using OID:
• Are efficient
• Are fast
• Cannot be modified by users (system generated)
• Independent of content
Attributes
• Called instance variables
• Domain
Object state
• Object values at any given time
• Values of attributes at any given point in time.
Methods
• Code/function that performs operation on object’s data
• Has name and body
• Methods define the behavior of object
• Can be used to change the state of the object by modifying attribute values
Messages
• Means by which objects communicate
• Request from one object to the other to activate one of its methods
• Invokes method/calls method to be applied
• Sent to object from real world or other object
• Notation: Object.Method
• Eg: StaffObject.updatesalary(slary)
Classes
• Blueprint for defining similar objects
• Objects with similar attributes and respond to same message are grouped together
• Defined only once and used by many objects
• Collection of similar objects
• Shares attributes and structure
• Objects in a class are called instances of the class
Eg: Class Definition: defining the class BRANCH
BRANCH
Attributes
brabchNo
street
city
postcode
Methods
Print()
getPostCode()
numberofStaff()
Objects of Branch class
brabchNo=B005 brabchNo=B007 brabchNo=B003
street=st1 street=st2 street=st2
city=Addis city=Dire city=Bahirdar
postcode=1425 postcode=452 postcode=85
Object Characteristics
Class Hierarchy
• Superclass
• Subclass
Inheritance
• Ability of object to inherit the data structure and behavior of classes above it
• Single inheritance – class has one immediate superclass
• Multiple – class has more than one immediate superclass
Method Overriding
• Method redefined at subclass
Polymorphism
• Allows different objects to respond to same message in different ways
Object Classification
• Simple
Only single-valued attributes
No attributes refer to other objects
• Composite
At least one multi-valued attribute
No attributes refer to other object
• Compound
At least one attribute that references other object
• Hybrid
Repeating group of attributes
At least one refers to other object
Characteristics of OO Data Model
• Supports complex objects
• Must be extensible
• Supports encapsulation
• Exhibit inheritance
• Supports object identity
OO vs. E-R Model Components
OO Data Model E-R Model
Type Entity definition
Object Entity Instance
Class Entity set
Instance variable Attribute
N/A Primary key
OID N/A
Class hierarchy E-R diagram
OODBMS
• Object-oriented database technology is a marriage of object-oriented programming and
database technologies.
• Database management system integrates benefits of typical database systems with
OODM characteristics
• Handles a mix of data types (since OODBMS permits new data definition)
• Follows OO rules
• Follows DBMS rules
OO and Database Design
• Provides data identification and the procedures for data manipulation
• Data and procedures self-contained entity
• Iterative and incremental
• DBA does more programming
• Lack of standards
OODBMS Advantages
• More semantic information
• Support for complex objects
• Extensibility of data types (user defined data types)
• May improve performance with efficient caching
• Versioning
• Polymorphism: one operation shared by many objects and each acting differently
• Reusability
• Inheritance speeds development and application: defining new objects in terms of
previously defined objects Incremental Definition)
• Potential to integrate DBMSs into single environment
• Relationship between objects is represented explicitly supporting both navigational and
associative access to information.
OODBMS Disadvantages
• Strong opposition from the established RDBMSs
• Lack of theoretical foundation
• No standard
• No single data model
• Throwback to old pointer systems
• Lack of standard ad hoc query language
• Lack of business data design and management tools
• Steep learning curve
• Low market presence
• Lack of compatibility between different OODBMSs