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

ADB Assignment

The document discusses Object-Oriented Databases (OODB) and their advantages over traditional data models, emphasizing their ability to maintain object integrity and identity. It outlines key concepts such as encapsulation, object identity, and polymorphism, while detailing how OO databases support complex data structures and operations. The document also provides an example of a 'Student' object to illustrate these principles in a university database context.
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)
17 views

ADB Assignment

The document discusses Object-Oriented Databases (OODB) and their advantages over traditional data models, emphasizing their ability to maintain object integrity and identity. It outlines key concepts such as encapsulation, object identity, and polymorphism, while detailing how OO databases support complex data structures and operations. The document also provides an example of a 'Student' object to illustrate these principles in a university database context.
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
You are on page 1/ 9

Haramaya University

College of Computing and Informatics Department of Computer


Science
Advanced database Individual Assignment
Name: Afendi Mohammed Mengistu…………………….ID 0597/16
SUBMITTED TO: MR BAHAR .H
 Introduction
 Traditional Data Models:
 Hierarchical
 Network (since mid-60’s)
 Relational (since 1970 and commercially since 1982)
 Object Oriented (OO) Data Models since mid-90’s Object Model aims to
reduce the overhead of converting information representation in the
database to an application specific representation.
 Unlike a traditional database, an object model allows for data persistence
and storage by storing objects in the databases.
 The relationships between various objects are inherent in the structure of
the objects.
 This is mainly used for complex data structures such as 2D and 3D graphics
which must otherwise be flattened before storage in a relational database.

 Reasons for creation of Object Oriented Databases


- Need for more complex applications
- Need for additional data modeling features
- Increased use of object-oriented programming languages
- Commercial OO Database products
- Several in the 1990’s, but did not make much impact on mainstream
data management OO Database
- Object oriented databases or object databases incorporate the object
data model to define data structures on

 which database operations such as:


- creation
- retrieve
- update and deletion can be performed.
 They store objects rather than data such as integers and strings
 The relationship between various data is implicit to the object and
manifests as object attributes and methods
 Object database management systems extend the object programming
language with transparently persistent data, concurrency control, data
recovery, associative queries, and other database capabilities.
Object model
 The Object-Oriented Database System Manifesto by mandates that an
object- oriented database system should satisfy two criteria: it should be a
DBMS, and it should be an object-oriented system

 Thus OODB implements OO concepts such as:


- object identity
- polymorphism
- encapsulation and inheritance to provide access to persistent objects
using any OO-programming language.

 The tight integration between object orientation and databases provides


programmers a unified environment when dealing with complex data such
as 2D and 3D graphics.

 Object oriented databases are designed to work well with object oriented
programming languages such as Python, Java, Objective-C. Overview of
Object-Oriented Concepts

 Object-Oriented (OO) Databases Aim: To closely link real-world entities


with their database representations, maintaining object integrity and
identity for easy identification and operation.

 Object Definition: A distinct entity with attributes (state) and actions


(behavior).
 Complex Object Structure: OO databases support intricate object
structures to hold comprehensive object information, unlike traditional
systems that scatter data across relations.

 Instance Variables: These are similar to attributes but are encapsulated


within objects, controlling external visibility

 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

 In OO databases, objects may have an object structure of arbitrary


complexity in order to contain all of the necessary information that
describes the object.

 In contrast, in traditional database systems, information about a complex


object is often scattered over many relations or records, leading to loss of
direct correspondence between a real-world object and its database
representation.
 The internal structure of an object in OOPLs includes the specification of
instance variables, which hold the values that define the internal state of
the object.
 An instance variable is similar to the concept of an attribute, except that
instance variables may be encapsulated within the object and thus are not
necessarily visible to external users

 Some OO models insist that all operations a user can apply to an object
must be predefined. This forces a complete encapsulation of objects.

 To encourage encapsulation, an operation is defined in two


parts:

 signature or interface of the operation, specifies the operation name and


arguments (or parameters).

 method or body, specifies the implementation of the operation.

 Operations can be invoked by passing a message to an object, which


includes the operation name and the parameters.

 The object then executes the method for that operation

 This encapsulation permits modification of the internal structure of an


object, as well as the implementation of its operations, without the need
to disturb the external programs that invoke these operations.

 Some OO systems provide capabilities for dealing with multiple versions of


the same object (a feature that is essential in design and engineering
applications).
For example, an old version of an object that represents a tested and verified
design should be retained until the new version is tested and verified:
 very crucial for designs in manufacturing process control, architecture ,
software systems

 Operator polymorphism:

 This refers to an operation’s ability to be applied to different types of


objects; in such a situation, an operation name may refer to several distinct
implementations, depending on the type of objects it is applied to.
 This feature is also called operator overloading Object Identity, Object
Structure, and Type Constructors

 Unique Identity:

 An OO database system provides a unique identity to each independent

implemented via a unique, system-generated object identifier, or OID


 The main property required of an OID is that it be immutable
 Specifically, the OID value of a particular object should not change.
 This preserves the identity of the real-world object being represented. …
cont’d

 Type Constructors:

 In OO databases, the state (current value) of a complex object may be


constructed from other objects (or other values) by using certain type
constructors.
 The three most basic constructors are atom, tuple, and set.
 Other commonly used constructors include list, bag, and array.
 The atom constructor is used to represent all basic atomic values, such as
integers, real numbers, character strings, Booleans, and any other basic
data types that the system supports directly
 Encapsulation:
 One of the main characteristics of OO languages and systems– Related to
the concepts of abstract data types and information hiding in
programming languages

 Abstract Data Type (ADT): An abstract concept defined by axioms,


representing data and operations on that data.
 Encapsulation and Information Hiding: Objects contain both data and
operations, with information hiding separating external aspects from
internal details
 The concept of encapsulation means that an object contains both a data
structure and the set of operations that can be used to manipulate it.

 Specifying Object Behavior via Class Operations (methods):–

–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).

Type and Class Hierarchies and Inheritance:

• Type (class) Hierarchy– A type in its simplest form can be defined by


giving it a type name and then listing the names of its visible (public)
functions
– When specifying a type in this section, we use the following format,
which does not specify arguments of functions, to simplify the discussion:
• TYPE_NAME: function, function, . . . , function

• Subtype:– When the designer or user must create a new type that is
similar but not identical to an already defined type

• Supertype:– It inherits all the functions of the subtype


Consider a database for a university:

_ Object: A 'Student' is an object.

_ 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.

_ Type Constructor: The Student object uses constructors:

- ‘atom’ for basic types (e.g., name: string, GPA: float).


- ‘tuple’ to group attributes (e.g., student info: (name, address, major)).
- ‘set’ to store courses enrolled in.

-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.

You might also like