ARBAMINCH UNIVERSITY FACULTY OF
COMPUTING AND SOFTWARE
ENGINEERING
Advanced Database Systems
Name ID
Natnael Samson NSR/738/15
Submission Date : 00/00/2017
Submission to : Mr.Melaku
Object Oriented DBMS
Object-Oriented Database Management Systems (OODBMS) integrate object-
oriented programming concepts into database management, making it possible to
store objects directly in databases. This enables seamless interaction between the
database and object-oriented programming languages. Here's how the three object-
oriented concepts apply to OODBMS:
Abstraction
the process of hiding complex implementation details and exposing only the
necessary features of an object or system to the user. The database schema
abstracts the underlying storage details. Users interact with objects, rather than
worrying about low-level data storage mechanisms like tables or file systems.
Objects are stored and retrieved using methods, simplifying data access. For
instance, querying for a "Student" object will return the object directly, without
exposing the table-joining logic. Abstract classes in object-oriented programming
can also be used as part of the schema design in an OODBMS.
Encapsulation
the bundling of data (attributes) and methods (operations) that operate on the data
into a single unit (class or object). It restricts direct access to an object's data and
enforces access through defined interfaces.
Objects in the database encapsulate both state (data) and behavior (methods). For
example, an Employee object would include attributes like name and salary and
methods like calculateBonus().
3. Information Hiding
Information hiding is the principle of restricting access to the internal workings of
an object, exposing only what is necessary for the object to function. It protects the
integrity of an object by preventing unauthorized access or modification.
1
Objects in the database may hide certain attributes or methods from external
access. For example, sensitive fields like password might be private and only
accessible via controlled methods.
Metadata about objects (e.g., implementation details) is hidden from users,
focusing interactions on high-level abstractions.
Drawbacks of relational DBMS
Complexity in Handling Complex Datam
RDBMS struggles with complex data types such as multimedia files, geographical
data, and hierarchical or graph-based relationships.
Example: Storing and querying data like images, videos, or nested
structures is inefficient and requires additional tools or workarounds.
Scalability Issues
RDBMS scales vertically (adding more powerful hardware), which can be
expensive and has limits. Horizontal scaling (adding more servers) is not natively
supported.
Example: For very large-scale applications like social networks or IoT systems,
RDBMS may not handle the volume of data efficiently.
Performance Bottlenecks Complex joins, indexing overhead, and heavy
transactional operations can slow down performance, especially as data grows.
Example: Queries involving multiple joins across large datasets can become very
slow.
2
Limited Support for Unstructured Data
RDBMS is not well-suited for storing unstructured data like logs, emails, or
documents.
Redundancy and Overhead
RDBMS enforces ACID properties (Atomicity, Consistency, Isolation, Durability)
for transactions, which can introduce overhead.
Example: In systems where eventual consistency is acceptable, the overhead of
ensuring immediate consistency can be unnecessary.
OODBMS definitions
An OODBMS is a database management system that represents, stores, and
retrieves data as objects. It allows the storage of objects directly in the database
and supports features such as inheritance, encapsulation, and polymorphism from
object-oriented programming. Unlike relational databases, which rely on tables,
rows, and columns, OODBMS manages data as objects with attributes and
behaviors, aligning more naturally with modern programming paradigms. This
reduces the "impedance mismatch" between databases and object-oriented
applications.
OO Database Design and Implementation
Designing and implementing an Object-Oriented Database (OODB) involves integrating object-
oriented programming principles with database design to store, manipulate, and retrieve data as
objects. This process ensures consistency, efficiency, and seamless interaction between
applications and the database.
key steps and considerations.
3
Requirements Analysis : Understand the application's data and behavior requirements
Steps in Requirements Analysis
Identify entities (objects) and their relationships.
Determine operations (methods) required for each object.
Define constraints and rules for data integrity.
Object-Oriented Data Model Design
Key Components:
Objects: Define objects with attributes (data) and methods (behavior).
Classes: Group similar objects into classes with shared attributes and
methods.
Inheritance: Establish hierarchical relationships between classes to enable
reuse and polymorphism.
Associations: Model relationships between objects, such as one-to-one,
one-to-many, or many-to-many.
Aggregation and Composition: Represent whole-part relationships.
Schema Design
Steps in Schema Design
Define the database schema using an object-oriented approach.
Use object modeling tools (e.g., UML) to create class diagrams
representing the schema.
Include identifiers for object uniqueness (e.g., object ID).
Mapping Object-Oriented Concepts to Database Constructs OODBMS
directly stores objects as opposed to converting them into tables and rows (as in RDBMS).
Persistence is implemented by storing object instances, maintaining identity, and linking
references between objects.
Query Language Design Use an Object Query Language (OQL) to interact with the
database.
Example: Retrieve all "Student" objects whose "grade" is greater than 85.
Implementation Steps
4
Select an OODBMS: Choose a suitable OODBMS (e.g., ObjectDB,
db4o, or Versant).
Database Setup:
Define and create the schema in the OODBMS.
Populate the database with initial objects.
Application Integration:
Develop application code to interact with the database.
Ensure seamless object persistence (e.g., saving and retrieving objects).
Test and Optimize
Validate that the system meets functional requirements.
Optimize queries, indexing, and object relationships for performance.
Key Features and Considerations of Object-Oriented Databases
Object-Oriented Databases (OODBMS) offer distinct features that differentiate
them from traditional database systems. These features not only enhance data
representation but also ensure robust, flexible, and secure handling of data. Below
is an expanded explanation of key features and considerations:
Encapsulation
Encapsulation is the bundling of data (attributes) and methods (behavior) into a
single unit called an object. This feature ensures that an object’s internal state is
hidden and accessible only through defined methods.
Details:
Data Integrity: Encapsulation ensures that data cannot be directly modified,
preventing unintended changes or corruption.
For example, a "BankAccount" object might expose methods like deposit()
and withdraw(), but the internal balance attribute is not directly accessible.
Security: Access to sensitive data is controlled by methods, allowing strict
enforcement of business rules and validation.
5
Reusability: Encapsulated objects and their methods can be reused across
different applications, reducing development effort.
Identity (OID)
Object Identity (OID) refers to the unique identifier assigned to each object in an
OODBMS, which remains consistent throughout the object’s lifecycle, regardless
of its state.
Details:
Uniqueness: Unlike primary keys in relational databases, OIDs are
immutable and system-generated, ensuring each object is distinct.
State Independence: An object can change its attributes (e.g., a "Student"
object updates its address), but its OID remains unchanged.
Reference Management: Objects can be referenced by their OID, enabling
complex relationships without the need for foreign keys.
For example, a "Course" object might reference multiple "Student" objects
by their OIDs, facilitating efficient association.
Versioning
Versioning is the ability to maintain multiple versions of an object to track its
changes over time, allowing historical reference or rollback to previous states.
Details:
Change Tracking: Enables detailed tracking of modifications to an object.
Example: In a "Document" object, each saved edit could create a new
version, retaining the original content.
Rollback and Auditing: Versioning allows rollback to previous states in
case of errors or for auditing purposes.
6
Concurrent Updates: By maintaining versions, conflicts during concurrent
modifications can be managed effectively.
Use Case:
In a project management system, versioning can track updates to "Project"
objects, retaining a history of changes made by different team members.
Concurrency Control
Concurrency control refers to mechanisms that manage simultaneous access to
objects by multiple users or processes, ensuring data consistency and integrity.
Details:
Locking Mechanisms:
o Pessimistic Locking: Prevents other users from modifying an object
while it is being accessed.
o Optimistic Locking: Assumes conflicts are rare and resolves them
when they occur.
Transaction Management: Supports atomic operations on objects,
ensuring that either all changes succeed or none are applied.
Conflict Resolution: Detects and resolves conflicts caused by concurrent
updates to the same object.
Scalability: Advanced concurrency control ensures high performance even
in environments with numerous simultaneous users.
Use Case:
In an e-commerce platform, concurrency control prevents two customers
from purchasing the last unit of a product simultaneously.
Advantages of OO Database Design
7
Seamless integration with object-oriented programming languages.
Better modeling of real-world entities with complex relationships.
Reusability through inheritance and polymorphism.
Enhanced support for multimedia, spatial, and hierarchical data.
Challenges
Complexity: Designing OO schemas can be complex for large systems.
Tool Support: Limited availability of mature OODBMS compared to
RDBMS.
Performance: May require optimization for large-scale or high-performance
systems.
Standardization: Lack of universal standards like SQL for RDBMS.
Object-Oriented Data Modeling and E-R Diagramming
Object-Oriented (OO) Data Modeling and Entity-Relationship (E-R) diagramming
are techniques used to design databases, but they approach data representation
differently. Below is a breakdown of OO data modeling, E-R diagramming, and
how they complement each other.
Object-Oriented Data Modeling : Object-oriented data modeling uses
objects, classes, and relationships to represent data and its behavior in a
database.
Key Components
Objects: Real-world entities represented with attributes (data) and methods
(operations).
Classes: Templates for creating objects; define attributes and methods.
Attributes: Characteristics or properties of an object.
Methods: Operations or behaviors associated with an object.
Relationships: Connections between objects, such as association,
aggregation, or inheritance.
8
E-R Diagramming : Entity-Relationship (E-R) diagrams are a visual representation of
data entities, their attributes, and relationships in a database.
Key Components:
Entities: Real-world objects or concepts (e.g., Student, Course).
Attributes: Properties of entities (e.g., Student has Name, Age).
Relationships: Connections between entities (e.g., Student enrolls in
Course).
Differences Between OO Modeling and E-R Diagramming
Feature OO Data Modeling E-R Diagramming
Focus Objects and their behaviors. Entities and relationships.
Includes classes, objects, Focuses on entities,
Structure
inheritance. attributes, and keys.
Methods define behaviors of
Behavior Behavior is not modeled.
objects.
Includes associations, Uses primary/foreign keys
Relationships
aggregation, inheritance. to show relationships.
Supports encapsulation and Static representation of
Dynamic Features
polymorphism. data.
Mapping OO Data Model to E-R Diagram
While OO modeling emphasizes objects, behaviors, and inheritance, E-R diagrams
emphasize entities and relationships. Here’s how you can map between the two:
Classes ↔ Entities : Each class in the OO model corresponds to an entity in
the E-R diagram.
Example: Book class ↔ Book entity.
Attributes ↔ Attributes : Class attributes map directly to entity attributes.
Example: Book.title ↔ Title attribute of the Book entity.
Inheritance ↔ Generalization : Inheritance in OO maps to generalization
in E-R diagrams.
9
Example: Media (general) ↔ Book and DVD (specialized entities).
Relationships ↔ Relationships : Associations in OO modeling translate to
relationships in E-R diagrams.
Example: Member borrows Book ↔ Member entity related to Book entity.
Object Identity in Object-Oriented Databases
Object Identity is a fundamental concept in object-oriented databases
(OODBMS). It ensures that each object is uniquely identifiable, independent of its
state or attributes. This is crucial for maintaining object consistency and enabling
object relationships.
Key Features of Object Identity
1. Uniqueness: Every object in the database has a unique identifier that
distinguishes it from all other objects, even if they have identical attributes.
Example: Two Person objects with the same name and age will have different identities.
2. Permanence: The identity of an object remains constant throughout its
lifetime, regardless of changes to its state.
Example: A Book object with an identifier remains the same even if its title is updated.
3. System-Defined: The object identifier (OID) is typically assigned and
managed by the OODBMS, not by the user.
4. Non-Replicable: The OID is unique across the entire database and cannot
be duplicated.
Types of Object Identity
1. Physical Identity : Defined by the memory location or physical address where the
object is stored.
Limitation: Tied to the storage system, which may not persist across sessions or systems.
10
2. Logical Identity : Defined by a unique identifier assigned by the database
(e.g., an Object Identifier or OID).
Advantage: Independent of physical storage, making it more flexible and reliable.
3. External Identity:
Defined by attributes that are unique across objects.
Example: A Student object might use student-ID as its external identity.
Importance of Object Identity
1. Enables Relationships: Objects can reference each other using OIDs,
supporting complex relationships like associations and hierarchies.
Example: A Loan object can reference a Book and a Member using their OIDs.
2. Ensures Consistency: Object identity ensures that changes to an object
are reflected across all references to it.
Example: Updating a Customer object updates all instances referencing that customer.
3. Supports Persistence: Persistent storage of objects in OODBMS relies
on object identity to retrieve objects accurately.
4. Simplifies Querying: Query results reference objects via their OIDs,
ensuring consistent results even with dynamic data.
Object Identity
1. Definition: Object identity is a unique identifier assigned to each object,
distinguishing it from others irrespective of its attribute values.
2. Key Features:
1. System-Generated Identifier: Often implemented as Object IDs
(OIDs).
11
2. Persistence: Maintains its identity even if the object’s state
changes.
3. Advantages: Enables referencing objects directly and efficiently,
ensuring data consistency across relationships.
12