Unit 9 Object Oriented DBMS
Unit 9 Object Oriented DBMS
SEMESTER 1
O02CA504
DATABASE MANAGEMENT SYSTEM1
Unit: 9 – Object Oriented DBMS
O02CA504: Database Management System
Unit 9
Object Oriented DBMS
TABLE OF CONTENTS
Fig No /
SL SAQ /
Topic Table / Page No
No Activity
Graph
1 Introduction - -
4
1.1 Objectives - -
7 Relationships - 6, I 16-17
8 Identifiers - 7 18
14 Glossary - - 31
15 Terminal Questions - - 32
16 Answers - - 33-34
17 References - - 35
1. INTRODUCTION
In the previous unit, you studied the concept of parallel database architectures. You also studied
the concept of parallel query evaluation, parallelising individual operations, I/O Parallelism, etc.
In today's world, Client-Server applications that rely on a database on the server as a data store
while servicing requests from multiple clients are quite commonplace. The majority of these
applications use Relational Database Management System (RDBMS) as their data store
simultaneously with an object-oriented programming language for development. This causes
certain inefficiencies as objects must be mapped to tuples in the database and vice versa.
Versa instead of the data being stored in a way that is consistent with the programming model. To
overcome this problem, Object-Oriented Database Management Systems (OODBMS) have been
developed.
In this unit, you will study the concept of object-oriented DBMS. You will learn about object-
oriented paradigms and architectural approaches of OODBMS. Also, you will recognise the
concept of object-oriented data model, OODBMS terminology, type hierarchies and inheritance.
We will also discuss the concept of type extents and persistent programming languages.
1.1. Objectives
After studying this unit, you should be able to:
2. OBJECT-ORIENTED PARADIGM
The object-oriented model or paradigm relies on the encapsulation of data and code into one unit.
All the interactions among one object and its system are performed through messages. Therefore,
a set of allowed messages defines the interface between an object and its system. Generally, an
object has an association with:
• A group (set) of methods, where every method is a set of code to execute every message.
A method submits a value as a reply to the message.
• A group (set) of variables that include the object data. The measure of every variable is by
itself one object.
• A group (set) of messages and the object reacts to these messages.
Now let us discuss the incentive of using messages & methods. For example, consider employees'
objects and annual wages as messages. Every employee object reacts to the yearly wage
message but in dissimilar calculations for managers, back-end employees, etc.
As the sole external interface portrayed by one object is a pack of messages to which it reacts, it
is feasible to:
Modifying the definition of variables and methods does not have any effect on the remaining
system.
The main benefit of the object-oriented paradigm is the capability to modify an object definition
without having an effect on the remaining system. You can classify the methods of any object as
either ‘read-only’ or ‘update’. Also, you can classify a message as ‘read-only’ or ‘update’. You can
express the entity’s derived attributes in the ER model as read-only messages.
Another major benefit of the object-oriented paradigm is its ability to be understood easily. It
facilitates the natural illustration of real-world objects, their mutual relationships and behaviour and
is thus close to customers. An object-oriented application comprises a set of objects with their own
private state, having an interaction among themselves. Object-oriented systems can be
maintained easily since they are modular and objects are independent of each other.
Other objects in the system should not be affected by a change in one object. The object-oriented
paradigm removes the requirement for shared data areas, hence diminishing system coupling.
The paradigm assists reusability. Objects are self-reliant and may be utilised in other suitably
similar applications.
SELF-ASSESSMENT QUESTIONS – 1
1. __________ are said to be self-reliant and may be utilised in other suitably similar
applications.
Client processes manage application-specific activities like utilisation and updation of separate
objects. These processes may be situated on the same workstation or on dissimilar workstations.
Usually, a single server will communicate with numerous clients, providing simultaneous requests
for data which is managed by that server. A client may interact with numerous servers to use data
distributed all through the network.
Three different workstation-server architectures have been proposed for use with OODBMS.
These are discussed below:
An object is considered as the unit of transfer from server to client. Both machines store objects
and are competent in performing methods on objects. Object-level locking is carried out easily.
The main disadvantage of this approach is the overhead related to the server interaction needed
to access each object.
Another disadvantage is the added complexity of the server software, which must offer whole
OODBMS functionality.
In this approach, we consider the page to be the unit of transfer from server to client. The overhead
of object access is decreased by the transfers of page level since it does not need server
interaction at all times. You can simplify the architecture and implementation of the server as it
only needs to execute the services of backend databases.
A probable disadvantage of this approach is that methods can be assessed only on the client.
Therefore, all objects that an application uses must be transported to the client. Here, it is difficult
to implement object-level locking.
In this approach, the client processes of OODBMS have an interaction with a network file service
for reading and writing database pages. This approach simplifies the process of server
implementation because there is no need to manage secondary storage. The main disadvantage
of this approach is that it requires two network interactions for accessing data.
From the three different approaches discussed above, the page server approach provides buffer
pools and efficient clustering algorithms. If a large amount of data is scanned by applications, the
object server approach performs badly but is better as compared to the page server approach for
applications executing numerous updates and executing on workstations with small buffer pools.
Objects that are stored in a consumer’s memory may need more processing. The cost and
procedure of releasing locks and updated objects that are returned to the server should be
considered.
When transferring a number of objects, further server interaction may not be required to ensure
these further object accesses.
Object clustering can be defined as the capability of an application to offer information to the
object-oriented DBMS. This is done so that objects which are usually accessed mutually can be
accumulated close to each other and, therefore, benefit from bulk transfers of data.
Frequently, the processors will be from dissimilar computer companies, and each company
comprises its own data representation formats. To make applications work together in this kind of
environment, data must be converted to the representation format appropriate for the processor.
Then, the data is accumulated enduringly by a server and momentarily by a client who desires to
access the data. To make object-oriented DBMS an efficient integration method, it must support
data access in heterogeneous processing surroundings.
SELF-ASSESSMENT QUESTIONS – 2
3. In which of the following approaches is the unit of transfer to the client from the server
regarded as a page?
(a) Page Server
(b) File Server
(c) Object Server
(d) Blade server
4. You can define object clustering as the potential of an application to offer information
to object-oriented DBMS. (True/ False)
4. OBJECT IDENTITY
An identity of an object is maintained even when all or some values of variables or even definitions
of methods vary with time. The object identity concept is essential in applications. However, it
does not relate to relational database tuples.
Object identity is considered a powerful concept of identity as compared to the ones that are
usually seen in programming languages or in data models, which are not based on object
orientation.
Name: This signifies a user-supplied name which is utilised for identity, e.g., the name of a
file in the file system.
Value: This signifies a value of data which is utilised for identity, e.g., the primary key of
one row in a single relational database.
Built-in: This signifies that an idea of identity is built (created) into programming languages
or the data model, and it does not need any user-supplied identifier.
You can implement object identity through an exclusive, system-generated object identifier (OID).
The external user cannot see the value of OID. However, it can be utilised by a system internally
to recognise every object in a unique manner and to generate and handle the references of inter-
object.
Identifiers produced by the system are generally particular to the system. If data are moved to
another database system, then identifiers need to be translated. If entities that are being modelled
previously contain distinctive identifiers from outside the system, then identifiers produced by the
system may not be necessary.
SELF-ASSESSMENT QUESTIONS – 3
6. The value of OID can’t be viewed by the external user. (True/ False)
This data can only be accessed by OODBMS procedures related to that particular object. To be
an appropriate OODBMS, it is necessary for the database to be comprised of procedures besides
just data.
Encapsulation basically signifies hiding the data inside the object from the outside classes.
Classes perform the encapsulation of the attributes and behaviours of their objects.
By means of behaviour encapsulation, the users of the class are not allowed to view the internal
implementation of behaviour. This process offers some amount of data independence in order that
users are not required to be modified when behaviour implementations are modified. Attributes of
a class may or may not be encapsulated.
Changing the definition of the attributes of a class that are not encapsulated needs variation for
all users that use them. The attributes that users of a class cannot use are encapsulated. Attributes
that are encapsulated generally comprise of behaviours that offer some kind of access to the
attribute by the users. Variations to these attributes usually do not need variation to users of the
class.
SELF-ASSESSMENT QUESTIONS – 4
7. Which of the following processes hides the internal data of the object from the outside
classes?
(a) Implementation
(b) Encapsulation
(c) Attribute hiding
(d) Inheritance
8. By means of behaviour encapsulation, the users of the class are allowed to view the
internal implementation of behaviour. (True/False)
1. Object and object identifier: An entity of any real world is known as an Object (related with a
unique ID: utilised to refer to an object for retrieval). In object-oriented databases, OID identifies
the objects uniquely. OID format is particular for every system.
2. Attributes and methods: Each object comprises a state and behaviour, where a state is the
group of values for the object’s attributes and behaviour is the group of methods, that is, code
which functions on the state of the object. Only by passing a clear message can we access or
invoke the state and behaviour that are encapsulated in an object. [An instance variable whose
domain can be any class, that is, user-defined or primitive, is known as an attribute.]
3. Class: A class includes a set of all objects which partake (share) the same group of methods
and attributes. The object must relate to just one class. An object is considered an example for
that class.
4. Class hierarchy and inheritance: This includes deriving a new class (which is known as a
subclass) from a current class (which is known as a superclass). All the methods and attributes of
the current class are inherited by a subclass. Also, a subclass may comprise additional attributes
&methods. The concept of single inheritance (class hierarchy) and multiple inheritances will be
discussed further in this unit.
SELF-ASSESSMENT QUESTIONS – 5
9. You cannot use a database system to implement a data model. (True/ False)
10. Which of the following can be defined as the group of values for the object’s attributes?
(a) State
(b) Class
(c) Behaviour
(d) Method
7. RELATIONSHIPS
Relationships are one of the significant constituents of the object-oriented paradigm. Relationships
permit objects to consider each other and affect networks of interrelated objects. Relationships
are considered as the paths utilised to carry out navigation-based data access.
The capability to directly and proficiently display relationships is one of the main enhancements of
the Object-Oriented data model over the relational data model. This decreases data independence
depending on the occurrence of relationships and indexes.
Theoretically, you can consider relationships as abstract entities that permit objects to refer to
each other. An OODBMS may select to symbolise relationships as attributes of the class (from
which the relationships originate), as independent objects (where case relationships may be
extensible and permit attributes to be added to a relationship), or as hidden data structures
connected to the owning object in some way.
We frequently call relationships as references, associations, or links. At times, we use the term
relation to signify the schema definition of the potential for interconnections among objects. We
use the term relationship to signify actual incidences of interconnection among objects. Here, the
term relationship is used interchangeably for both the schema definition as well as the object-level
existence of connections among objects.
Though we can discover much about an object by observing its attributes, at times, a significant
fact about an object is the manner in which it connects to other objects in the same or another
class.
Example: Let us consider a class known as a movie. Below, we have given the declarations of
four attributes that comprise all movie objects.
1. class Movie {
2. attribute string Name;
3. attribute integer Year;
4. attribute integer length;
5. attribute enum Film {colour, black and white } film Type;
Now, assume that you want to add a property (that is, a set of stars) to the declaration of the Movie
class. More specifically, we would like to connect.
Each Movie object is to the set of Star objects. The best manner to symbolise this connection
among the classes, Movie and Star, is with a relationship. This relationship can be represented in
the Movie by the following line:
The above line is represented in the declaration of class Movie. This line may emerge after any of
the lines numbered (1) to (5). It signifies that in every object of class Movie, there is a group of
references to Star objects. The set of references is known as stars. Here, the keyword relationship
indicates that stars enclose references to other objects, whereas the keyword Set previous
to<Star> indicates that stars refer to a set of Star objects instead of a single object.
SELF-ASSESSMENT QUESTIONS – 6
12. Which of the following components of the object-oriented paradigm is used to carry out
navigation-based data access?
(a) Identifiers
(b) Relationships
(c) Inheritance
(d) Attributes
Activity I
Illustrate the concept of relationships in OODBMS with examples.
8. IDENTIFIERS
Object identifiers can uniquely identify objects.
You can store object identifiers as a field of an object, and they are referred to another object. For
example, the field of a person object named as spouse can be considered as an identifier of
another person object.
To identify the object in some of the systems, only 4 bytes with object position or object index in
the file are sufficient. However, in some other systems, object identifiers are more complicated
and maintain exclusiveness even outside the local computer’s range.
SELF-ASSESSMENT QUESTIONS – 7
13. Object identifiers cannot be accumulated as a field of an object. (True/False)
14. For identifying the object in some systems, only __________ bytes with object index or
object position in the file is sufficient.
Classes: A class defines the data values accumulated by an object of that class. Every object is
related to just one class. An object is frequently considered as an instance of a class. Specification
of a class offers the outside view of the class’s instances. In the case of OODBMS, the class
construct is usually utilised to define the schema of a database. Make note that some object-
oriented databases make use of the term type in place of a class. The objects that are to be
accumulated inside the database are defined by OODBMS.
Inheritance: Inheritance is defined as the process where the behaviour and properties of the
parent object are inherited by the child object. If class ‘A’ is derived from class ‘B’; all methods of
class ‘B’ are inherited by class ‘A’. Also it can be applied all over where class ‘B’ can be employed.
SELF-ASSESSMENT QUESTIONS – 8
15. Object is considered as an __________ of a class.
16. What do you call the process where the behaviour and properties of the parent object
are inherited by the child object?
(a) Encapsulation
(b) Inheritance
(c) Polymorphism
(d) Message passing
Declaration of interfaces and classes is comparable to C++ and Java syntax but not quite the
same. However, the restrictions of a class or interface declaration are taken directly from C++. We
have shown the declaration below.
Class class_name
// class methods
};
Interface interface_name
// interface methods
};
We begin every declaration with either the keyword class or interface to recognise the element
which is being declared. After writing the keyword, we write the name of the interface or class.
This is to note that the class or interface names start with uppercase letters.
If one or more interfaces are implemented by a class, a separation from a class name is provided
between those interfaces by a colon:
//class methods
};
Now, if a class inherits from a superclass, it extends the class, as shown below:
//class methods
};
SELF-ASSESSMENT QUESTIONS – 9
17. If you want to implement one or more interfaces by a class, then a separation
between those interfaces from a class name is provided by a __________.
18. An interface illustrates the behaviour or ability of a class without performing a specific
implementation. (True/ False)
In the simplest manner, a type could be defined by providing it a type name and, after that, giving
the names of its public (visible) functions.
To permit the direct demonstration of similarities between classes, it is required to put classes in
a specialisation hierarchy. For example, we have shown a specialisation hierarchy for the E-R
model in Figure 1.
The class hierarchy concept is said to be analogous to the specialisation hierarchy. We have
shown the consequent class hierarchy in Figure 2.
We can define the class hierarchy in pseudo-code. Now, we will show the definition of class
hierarchy in pseudo-code. Also, we have shown the variables related to each class. This is shown
as below:
Class person
};
Int credit-rating:
};
};
};
};
};
When a new type is generated by the user that is analogous but not the same as a previously
defined type, it is known as a subtype. All the functions of the subtype are inherited by a supertype.
The supertype, which is situated at the top of the type hierarchy, includes a set of fields that is
inherited by all related subtypes. Before creating a subtype, the existence of a supertype is a must.
We use the keyword ‘isa’ to signify that one class is considered as a specialisation of another
class. We call the specialisation of a class as sub-classes. For example, a sub-class of person
(super-class) can be an employee.
A subclass of employee (super-class) can be a cashier (or teller). On the other hand, an employee
is considered a super-class of the cashier (or teller).
There are two probable methods of relating objects with non-leaf classes:
• Associate all employee objects comprising the instances of officer, teller, and secretary.
With the employee class
• Associate merely those employee objects that are instance neither teller nor officer nor
secretary, with the employee class.
Usually, the second option is made in object-oriented systems. In this case, it is possible to identify
the set of all employee objects by combining those objects related to all classes in the subtree
rooted at an employee.
Many object-oriented systems permit specialisation to be partial; that is, they permit objects that
relate to a class, like employees, that do not relate to any of the subclasses of that class.
Multiple inheritance
The capability of a class to inherit the variables and methods from numerous superclasses is
known as Multiple inheritance.
Mostly, the tree-structured organisation of classes is sufficient to illustrate applications. There are
circumstances that can’t be displayed substantially in one tree-structured class hierarchy.
For example, in Figure 9.3, we have created subclasses like part-time secretary, full-time
secretary, etc. But there are some problems:
(b) The full-time/part-time employees who are not considered secretaries and tellers cannot be
demonstrated in the hierarchy.
In Figure 4, we show the relationship between class and subclass. This is shown by a rooted DAG
(directed acyclic graph) where a class might comprise an extra superclass than one.
On the utilisation of multiple inheritance, there is possible uncertainty about whether you can
inherit the same method or variable from more than one superclass.
Example: Consider the example of banking, where a variable pay is defined for each full-time,
part-time, teller & secretary as given below:
Full-time: The salary is one integer from 0-100000, comprising yearly wages.
Part-time: salary is one integer from 0-30 comprising of a per-hour rate of wages.
Teller: Salary is one integer from 0-15000, comprising the yearly wages.
Secretary: Salary is one integer from 0-20000, comprising the yearly wages.
You can inherit the salary description from either part-time or from a secretary. In the case of a
part-time secretary, we have the following alternatives:
Tell the consumer to make an option at the time of class definition. Consider the situation
as an error.
Till now, no solution has been considered as best, and different systems make different selections.
All the cases in multiple inheritances do not lead to uncertainty. If rather than defining the salary,
we maintain the variable salary definition in a class employee, & do not define it anywhere, then
salary is inherited by all the subclasses from the employee (no uncertainty).
Multiple inheritances can be used to illustrate the concept of roles. For example, consider the
subclasses student, teacher, and football Player. For these subclasses, an object can relate to
numerous categories at once, and we call each of these categories a role.
SELF-ASSESSMENT QUESTIONS – 10
19. A class can be considered as a specialisation of another class by using the keyword
__________.
20. The object types can be specified by means of a type hierarchy. (True/ False).
In many object-oriented databases, the collection of objects, to an extent, comprises of the same
type or class. However, since types are supported by most object-oriented databases, it is
assumed that extents are collections of objects of the same type.
Persistent data is defined as the data that continues to occur even after the program that
generated it has finished.
• In the language of a persistent program, language is completely incorporated with the host
language and the same type of system is used by both. Any changes in format that are
needed in the databases are performed clearly.
• By means of Embedded SQL, the programmer is accountable for writing unambiguous
code to retrieve data from memory or send data back to the database.
• In the language of persistent programs, one programmer could use persistent data without
writing such code in an unambiguous manner.
SELF-ASSESSMENT QUESTIONS – 11
21. A programming language which is expanded by means of constructs to manage
persistent data is known as a __________.
Activity II
Explain the concept of handling name conflicts in multiple inheritance.
Give suitable examples.
13. SUMMARY
• The object-oriented model or paradigm relies on the encapsulation of the data and code into
one single unit.
• A set of allowed messages defines the interface between an object and its system.
• Enhancements in technologies of local area networks and workstations have given rise to
group design-type applications fulfilling the need for
• OODBMS.
• In the page server approach, we consider the page to be the unit of transfer from server to
client.
• In the file server approach, the client processes of OODBMS have an interaction with a network
file service for reading and writing database pages.
• The ability of the class to inherit the methods and variables from several superclasses is
multiple inheritance.
• A programming language which is expanded by means of constructs to manage persistent
data is known as a persistent programming language.
14. GLOSSARY
Multiple The capability of a class to inherit the variables and methods from
-
inheritance numerous superclasses is known as Multiple inheritance.
Non-leaf classes are abstract and can have further subclasses (child
Non-leaf classes -
classes).
16. ANSWERS
Answer 3: Type hierarchy allows the inheritance of both attributes & methods. The capability of a
class to inherit the variables and methods from numerous superclasses is known as Multiple
inheritance. Refer to Section 11 for more details.
Answer 4: A programming language which is extended with constructs to manage persistent data
is known as a persistent programming language. Refer to Section 12 for more details.
Answer 5: An interface is used to illustrate the behaviour or ability of a class without performing
a specific implementation. Refer to Section 10 for more details.
17. REFERENCES
• Prabhu, C.S.R. (2005), Object Oriented Database Systems, (2nd Ed.), PHI Learning Pvt.
Ltd.
• Khoshafian S. (1993), Object Oriented databases,(1stEd.), John Wiley.
E-references
• http://fria.fri.uniza.sk/~kmat/dbs/oodbs/OODBS1b.htm.
• www.cs.cityu.edu.hk/~jfong/cs3462/Lectures/Lecture9.ppt.