0% found this document useful (0 votes)
2 views

ADBS Assignment

ADBS NOTES

Uploaded by

yabdusabur
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

ADBS Assignment

ADBS NOTES

Uploaded by

yabdusabur
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

[THESIS TITLE]

Name:[Student Name]
Student ID: [Type the student ID]

Thesis Advisor:[Type the thesis

advisor's name]
[Due Date]
1. Overview of Object-Oriented (O-O) Concepts

Explanation:
Object-oriented concepts allow databases to model real-world entities as “objects”
that bundle both state (attributes) and behavior (methods). In advanced object-
oriented databases (OODBs), these objects can represent complex data and
relationships much more naturally than traditional table-based databases.

Example:
Imagine a multimedia database for a streaming service. Each media item (movie,
series, documentary) is modeled as an object with attributes (title, genre, releaseDate)
and methods (play, pause, rate). This encapsulation makes it easier to manage and
extend functionalities (like adding a recommendation engine) without redesigning the
entire database schema.

2. O-O Identity, Object Structure, and Type


Constructors

Object Identity:
Every object in an OODB has a unique identifier (OID) that distinguishes it from all
others—even if two objects share the same attribute values. This persistent identity is
crucial for managing complex relationships.

Example:
In our streaming service database, each media object gets a unique ID (say, mediaID).
Even if two movies have the same title or release year, their unique mediaID
distinguishes them, ensuring accurate references in user watch lists or
recommendation links.

Object Structure:
An object is structured to include both data (attributes) and operations (methods). This
design promotes the re-usability of code and maintains a clean separation between
data management and business logic.

Example:
A User object in the database might include attributes such as user-ID, username, and
subscriptionStatus, along with methods such as updateProfile(), subscribe(),
and cancelSubscription().

Type Constructors:
Type constructors build complex data types from simpler ones. Common constructors
include:

Tuple/Record Constructor: Defines a composite type with named fields.


Example: A Payment record with fields amount, date, and method.
Collection Constructors (Set, List, Array):
Example: A Playlist object may contain a list of mediaIDs representing the
sequence of media items the user intends to watch.

Dictionary Constructor: Maps keys to values.


Example: A UserPreferences object could map genre names to preference
ratings.

3. Encapsulation of Operations, Methods, and


Persistence

Encapsulation:
Encapsulation binds an object’s state and its operations into one unit, hiding the
internal details from the outside world. This prevents unintended interference and
misuse of the data.

Example:
Consider a BankAccount object in a financial application database. Its attributes (like
balance and accountNumber) are private, and operations such as deposit(amount)
and withdraw(amount) are the only ways to modify the balance. This ensures that all
transactions are validated internally before updating the state.

Methods and Operations:


Methods define the behavior of an object. They operate on the object's internal state
and can include complex business logic.

Example:
A Document object in a content management database might have a publish()
method. When called, this method not only changes the document’s status but also
triggers workflows such as versioning, indexing, and notifying subscribers.

Persistence:
Persistence in an OODB means that objects, once created, continue to exist even after
the application ends. This is achieved by storing the object’s state in the database,
along with its identity and relationships.

Example:
In an advanced scientific research database, experimental objects (which include
complex datasets, parameters, and analysis methods) are persisted across sessions.
Researchers can store a simulation’s state and later resume or replicate experiments
by referencing the unique object identities.

4. Type and Class Hierarchies and Inheritance


Type and Class Hierarchies:
OODBs use hierarchies to group objects that share common features. A superclass
defines attributes and methods common to all its subclasses, which can then add
specific features.

Example:
In a university information system database, a general Person class might include
attributes such as name and dateOfBirth. This class is then specialized:

Student subclass: Adds attributes like studentID, major, and methods such
as enrollCourse().

Professor subclass: Includes attributes like employeeID, department, and


methods such as assignGrade().

Inheritance:
Inheritance allows subclasses to inherit behavior and attributes from a superclass,
promoting code reuse and consistency.

Example:
Using the university system:

The Student and Professor classes inherit common methods from Person,
such as updateContactInfo().

Each subclass can override or extend methods. For example, while both
Student and Professor may have a getProfile() method inherited from
Person, Professor might extend it to include research publications.

Inheritance and hierarchies not only simplify the design but also ensure that common
operations are defined once and reused across multiple types, which is particularly
powerful in databases managing large and complex datasets.

Summary

Advanced object-oriented databases leverage these core concepts to model complex,


real-world scenarios more intuitively:

O-O Concepts provide a natural way to represent entities with both data and
behavior.

Object Identity, Structure, and Type Constructors ensure unique, well-


defined, and composite data types.

Encapsulation, Methods, and Persistence maintain data integrity and


streamline operations.
Type/Class Hierarchies and Inheritance promote code reuse and allow for
natural classification of data entities.

You might also like