Natnael Gulma Section 1
Natnael Gulma Section 1
Submitted To Mr . BAHAR H.
Haramaya, Ethiopia
MARCH 31. 2025GC
Page | 1
The Evolution and Significance of Object Databases
Page | 2
building blocks of OODBs and provide a natural way to model complex
systems.
• Classes:-a class serves as a blueprint for creating objects. It
outlines the structure and behavior that the objects instantiated
from it will have. A class defines a set of attributes and methods,
establishing a common template.
For instance, a class called Animal might specify that every animal object
should have attributes like species, color, and age, as well as methods
such as eat() and move(). By instantiating this class, multiple unique
objects (e.g., different animals such as a dog, cat, or bird) can be created,
each with its own distinct state but sharing common behaviors defined
by the class.
Key Principles of Object-Oriented Databases (OODB)
Object-oriented databases are built around several key principles that
enhance the way data is modeled, stored, and managed.
Page | 3
Example: A Library Management System can be divided into separate
modules like User Management (handling member information), Book
Management (managing book details), and Borrowing System
(processing checkouts and returns). This separation allows developers to
update one module without impacting the others.
4. Polymorphism: allows objects of different types to be treated as
objects of a common super type, enabling the same operation to
behave differently on different classes. It enables a single function
or operator to work in different ways depending on the type of
object it is applied to
Example: Consider a draw() method in a graphics application. If draw() is
called on a Circle, it renders a circle; if it is called on a Square, it renders
a square. The underlying implementation varies based on the object’s
type, yet the same method name is used for all.
Real-World Modeling with OODBs
Page | 4
Key requirements for an OID include:
❖ Object Structure
Page | 5
they can be complex types, including arrays, lists, or even nested
objects.
✓ Nested Objects:- can include other objects within their structure.
This “has-a” relationship allows the model to naturally represent
the composite nature of many real-world entities.
✓ Relationships: often have associations with one another—such as
aggregations or compositions—which outline how they interact
and depend on each other.
✓ Type Constructors
To manage the complexity of object structures, ODBs use type
constructors to build more complex types from simpler ones. These
constructors can be seen as the building blocks for creating the data
types needed to describe objects in the database.
For example, one can define a structured type for a person’s name as a
tuple with fields like First Name, Middle Initial, and Last Name. In many
cases, the struct constructor acts as a type generator, capable of
producing various structured types based on the components provided.
Page | 6
✓ Common collection constructors include:
Array(T): Functions like a list but typically has a fixed maximum size.
When a new type closely resembles an existing one but with additional
or modified functions, it is declared as a subtype of that base type (or
supertype). For instance, if we want to define two new types, EMPLOYEE
and STUDENT, which both include all the attributes of PERSON plus extra
functions, we can specify:
Page | 8
EMPLOYEE subtype-of PERSON: Salary, Hire_date, Seniority
STUDENT subtype-of PERSON: Major, Gpa
✓ For instance, the operator “+” may perform integer addition when
applied to numbers, floating point addition when used with real
numbers, or even a set union when applied to collections. The
compiler or runtime system determines the appropriate operation
based on the types of the operands.
Page | 9
Page | 10