0% found this document useful (0 votes)
3 views5 pages

Distributed Database Unit6

Uploaded by

Sital Mandal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

Distributed Database Unit6

Uploaded by

Sital Mandal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1

Unit 6: OODBMS Languages and Design


Object Model, Object Definition Language, Object Query Language, Object Database
Conceptual Design, Examples of ODBMSs.

1. Object Model
OODBMSs use an "object" as the fundamental modeling and access primitive,
representing real-world entities with a tuple consisting of an object identifier (OID),
state, and interface . The OID is an invariant property that distinguishes the object .
The state can be an atomic value or a constructed value (e.g., tuple or set) .

• An object model defines the structure and behavior of objects in an Object-


Oriented Database Management System (OODBMS).
• Objects consist of:
o Object Identifier (OID): A unique identifier for each object.
o State (Attributes): Stores data values.
o Behavior (Methods): Defines operations on the object.

Example:
type Car
attributes
make: String
model: String
engine: Engine
methods
start()
stop()

• has attributes make, model, and engine.


Car
• Methods start() and stop() define its behavior.

2. Object Definition Language (ODL)

The Object Data Management Group (ODMG) developed an object model along with
an Object Definition Language (ODL) .

• ODL is used to define classes, attributes, relationships, and methods in an


object database.
• It was standardized by ODMG (Object Data Management Group).
• Supports:
o Inheritance (subclassing)
o Encapsulation (hiding internal details)

pg. 1 Er. Sital Prasad Mandal


2

o Relationships (associating objects).

Example ODL Schema:


interface Person {
attribute string name;
relationship Set<Car> owns;
};
interface Car {
attribute string model;
attribute integer year;
};

• Person has an attribute name and a relationship owns to multiple Car objects.

3. Object Query Language (OQL)


The ODMG standard includes an Object Query Language (OQL)1. Although there has
been significant work on object query processing and optimization, these have
primarily focused on centralized systems.

• OQL is the query language for OODBMS, similar to SQL but designed for
objects.
• Defined by ODMG, it allows:
o Querying complex objects.
o Navigating object relationships.
o Using method invocations.

Example OQL Query:


SELECT [Link], [Link]
FROM Person p, [Link] c
WHERE [Link] > 2015;

• Retrieves names of people who own cars manufactured after 2015.

4. Object Database Conceptual Design

• Involves modeling real-world entities as objects with relationships.


• Steps:
1. Identify objects and classes (e.g., Person, Car).
2. Define attributes and relationships (e.g., Person owns Cars).
3. Establish type hierarchies (e.g., Car is a subclass of Vehicle).
4. Encapsulate behavior using methods.

pg. 2 Er. Sital Prasad Mandal


3

Example Design:

• University Database:
• type Student extends Person {
• attribute integer studentID;
• attribute Set<Course> enrolledCourses;
• }

• type Course {
• attribute string courseName;
• attribute integer credits;
• }
• A Student has studentID and can enroll in multiple Courses.

5. Examples of ODBMSs

Some popular Object Database Management Systems (ODBMSs) include:

1. ObjectDB: High-performance, Java-based OODB.


2. db4o: Lightweight, open-source OODB for embedded systems.
3. Versant: Scalable OODB used in enterprise applications.
4. GemStone/S: A robust OODB for distributed systems.
5. ODMG-Compliant Databases: Follow ODMG standards for object
management.

Conclusion

• OODBMSs extend relational databases by incorporating objects,


encapsulation, and inheritance.
• OQL and ODL provide query and schema definition functionalities.
• They are useful in applications requiring complex relationships, multimedia
storage, and real-world modeling.

1. Object Model in OODBMS


The Object Model in OODBMS extends traditional relational databases by introducing
object-oriented principles such as objects, classes, inheritance, and encapsulation.

Key Components of Object Model


1. Objects – Represent real-world entities with attributes and methods.

2. Classes – Define object types and serve as templates.

pg. 3 Er. Sital Prasad Mandal


4

3. Inheritance – Allows new classes to reuse properties from parent classes.

4. Encapsulation – Combines data (attributes) and behavior (methods).

5. Persistence – Objects remain stored beyond program execution.

6. Object Identity (OID) – Each object has a unique system-generated identifier.

2. Object Definition Language (ODL)


ODL is used to define the structure of an object-oriented database, specifying classes,
attributes, relationships, and methods.

ODL Syntax Example


Example of defining an Employee class:

class Employee {
attribute string emp_name;
attribute int emp_id;
relationship Department works_in;
void get_salary();
};

Key features of ODL include support for inheritance, relationships, and encapsulation.

3. Object Query Language (OQL)


OQL is similar to SQL but designed for querying objects instead of relational tables.

OQL Syntax Example


Example of retrieving employee names from a department:

SELECT e.emp_name FROM Employee e WHERE e.works_in.name = 'IT';

OQL supports complex objects, relationships, and procedural logic.

4. Object Database Conceptual Design


Designing an object-oriented database involves defining objects, relationships, and
methods.

Steps in OODBMS Design


1. Requirement Analysis: Identify objects and relationships.

2. Conceptual Design: Create an object-oriented schema.

3. Logical Design: Map the schema to an OODBMS model.

4. Physical Design: Optimize storage and indexing.

pg. 4 Er. Sital Prasad Mandal


5

5. Examples of OODBMS Implementations


Several OODBMS are used in real-world applications, including:

1. ObjectDB – High-performance Java-based OODBMS.

2. db4o – Open-source OODBMS for Java and .NET.

3. Versant – Used in large-scale enterprise applications.

4. GemStone – Supports distributed object databases.

5. ZODB – Python-based object-oriented database.

pg. 5 Er. Sital Prasad Mandal

You might also like