ADB Assignment
ADB Assignment
Object oriented databases are designed to work well with object oriented
programming languages such as Python, Java, Objective-C. Overview of
Object-Oriented Concepts
Main Claim:
OO databases try to maintain a direct correspondence between real
world and database objects so that objects do not lose their integrity
and identity and can easily be identified and operated upon
Object:
Two components:
- state (value) and behavior (operations
- Similar to program variable in programming language, except that it will
typically have a complex data structure as well as specific operations
defined by the programmer
Some OO models insist that all operations a user can apply to an object
must be predefined. This forces a complete encapsulation of objects.
Operator polymorphism:
Unique Identity:
Type Constructors:
–The main idea is to define the behavior of a type of object based on the
operations that can be externally applied to objects of that type
– For database applications, the requirement that all objects be
completely encapsulated is too stringent.
– One way of relaxing this requirement is to divide the structure of an
object into visible and hidden attributes (instance variables).
• Subtype:– When the designer or user must create a new type that is
similar but not identical to an already defined type
_ Attributes (State): The Student object has attributes like name, address,
student ID (unique), major, and GPA.
_ Operations (Behavior):
The Student object has operations like
enroll in a course
drop a course and calculate GPA.
_ Encapsulation:
The internal details of how the GPA is calculated are hidden; only the
calculate GPA operation is accessible.
_ Object Identity: Each Student object has a unique Student ID (OID) that
remains constant.
-Polymorphism:
The ‘calculate GPA’ operation might behave differently for
undergraduate and graduate students.
-Persistence:
Student objects are stored in the database and can be retrieved using
their Student ID.
- Type Hierarchy:
Student is a subtype of a Person type, inheriting attributes like
name and address, while adding specific attributes like major and GPA.