Unit 10 - V1
Unit 10 - V1
RELATIONAL DATABASE
MANAGEMENT SYSTEM
Unit 10
Object Oriented DBMS
Table of Contents
Fig No /
SL SAQ /
Topic Table / Page No
No Activity
Graph
1 Introduction - -
3
1.1 Objectives - -
2 Object Oriented Paradigm - 1 4-5
3 OODBMS Architectural Approaches - 2
3.1 Distributed client - server approach - -
3.2 Data access mechanism - - 5-8
3.3 Object clustering - -
3.4 Heterogeneous operation - -
4 Object Identity - 3 9-10
5 Procedures and Encapsulation - 4 10-11
6 Object Oriented Data Model - 5 11-12
7 Relationships - 6 13-14
8 Identifiers - 7, I 15
9 Basic OODMS Terminology - 8 16
10 Basic Interface and Class Structure - 9 17-18
11 Type Hierarchies and Inheritance 1, 2, 3, 4 10 18-23
12 Type Extents and Persistent Programming - 11 24
Languages
13 Summary - - 25
14 Glossary - - 26
15 Terminal Questions - - 27
16 Answers - - 27-28
17 References - - 28
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. 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
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 paradigm 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:
❖ Discuss object oriented paradigm
❖ Recognise OODBMS architectural approaches
❖ Describe object identity, its procedures and encapsulation
❖ Explain object oriented data model
❖ Describe relationships and identifiers
❖ Discuss basic OODBMS Terminology
❖ Recognise basic interface and class structure
❖ Explain the concept of type hierarchies and inheritance
❖ Discuss the concept of type extents and persistent programming languages
Now let us discuss the incentive of using messages & methods: As an example consider
employees as objects and annual-wage as message. 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 pack of messages, to which it reacts,
it is feasible to:
• modify the variables and methods’ definition and not having any affect on the
remaining system
• substitute a variable with a method that calculates a value
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 ‘readonly’ or ‘update’. Also, you can classify message as ‘readonly’ or
‘update’. You can express the entity’s derived attributes in the E.R model as readonly
messages.
Another major benefit of the object oriented paradigm is its ability to understand easily. It
facilitates natural illustration of real-world objects, their mutual relationships and behaviour
and is thus close to customers. An object oriented application comprises of 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 change in one object. 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
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.
There are three different workstation-server architectures that have been proposed for use
with OODBMS. There are discussed as below:
The main disadvantage of this approach is the overhead related with the server interaction
needed to access each object.
Another disadvantage is the added complexity of the server software which must offer whole
OODBMS functionality.
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.
From the three different approaches discussed above, the page server approach provides
buffer pools and efficient clustering algorithms. If 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 into 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 number of objects, further server interaction may not be required to
assure these further object accesses.
Object clustering can be defined as the capability for 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 benefits from bulk transfers of data.
Frequently, the processors will be from dissimilar computer companies where each
company comprises its own data representation formats. To make applications work
together in this kind of an 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 approach, the unit of transfer to client from server is
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 as a powerful concept of identity as compared to the ones that
are usually seen in the programming languages or in the data models which are not based
on the object orientation.
You can implement object identity through an exclusive, system generated object identifier
(OID). The external user cannot see 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 there is a need to translate identifiers. If entities that are
being modelled previously contain distinctive identifiers which are from outside the system,
then identifiers produced by system may not be necessary.
SELF-ASSESSMENT QUESTIONS – 3
This data can only be accessed by OODBMS procedures which are related with that particular
object. To be an appropriate OODBMS, it is necessary for the database to comprise
procedures beside 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
of 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 process 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)
4. Class hierarchy and inheritance: This includes deriving a new class (which is known
as subclass) from a current class (which is known as superclass). All the methods and
attributes of the current class are inherited by a subclass. Also 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 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 effect in networks of inter-related
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 by depending on the occurrence of particular 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.
Though we can discover much regarding an object by observing its attributes, at times a
significant fact regarding 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 movie. We have given below the declarations of
four attributes that are comprised by all movie objects.
1. class Movie {
2. attribute string Name ;
3. attribute integer Year ;
4. attribute integer length ;
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 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 Movie by the following line:
relationship Set<Star> stars;
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 refers to a set of Star objects, instead of a single
object.
SELF-ASSESSMENT QUESTIONS – 6
Activity 1
Illustrate the concept of relationships in OODBMS with example.
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.
• Object identifiers can be considered as system generated (that is produced by
database) or external (such as social-security number).
To identify the object in some of the systems, only 4 byte with object position or object index
in file is sufficient. However, in some other systems, object identifiers are considered to be
more complicated and maintain exclusiveness even outside the local computer’s range.
SELF-ASSESSMENT QUESTIONS – 7
SELF-ASSESSMENT QUESTIONS – 8
Declaration of interfaces and classes is comparable to C++ and java syntax, but not quite the
same. But the restrictions of a class or interface declaration are taken directly from C++. We
have shown the declaration as 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 class_name : interface interface_name
{
//class methods
};
Now, if a class inherits from a superclass, it extends the class, as shown below:
Class class_name extends superclass_name:interface_name
{
//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 to 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.
An object oriented database usually needs numerous classes. Frequently, however, various
classes are analogous. For instance, bank employee is analogous to consumer.
Person
Employee Customer
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 with 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 to 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, an existence of supertype is
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 employee; a subclass of employee (super-class) can be cashier (or teller).
On the other hand, employee is considered as a super-class of 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 combing those objects related with all classes in
the subtree rooted at employee.
Many object oriented systems permit specialisation to be partial, that is, they permit objects
that relate to a class like employee that do not relate to any of subclasses of that class.
Multiple inheritance
The capability of class to inherit the variables and methods from numerous superclasses is
known as Multiple inheritance.
An example: In Figure 10.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 which are not considered as secretaries and tellers
both cannot be demonstrated in the hierarchy.
Person
Employee Customer
Fig 10.3: Class Hierarchy for Part Time and Full Time Employees
In Figure 10.4, we have shown the relationship of class and subclass. This is shown by a
rooted DAG (directed acyclic graph) where a class might comprise of extra superclass than
one.
Example: Consider the example of banking, where a variable pay is defined for each full-
time, part-time, teller & secretary as given below:
You can inherit the description of salary from either from part-time or from secretary. In
case of part-time secretary, we have the following alternatives:
• Comprise both variables, renaming them to part-time-pay and secretary- pay.
• Select one or the other depending on the order of creation.
• 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
salary, we maintain the variable salary definition in class employee, & do not define it
anywhere, then salary is inherited by all the subclasses from 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 as 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)
Persistent data is defined as the data that continue to occur even after program that
generated it, has finished.
SELF-ASSESSMENT QUESTIONS – 11
13. SUMMARY
Let us recapitulate the important points discussed in this unit:
• 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 among an object and its system.
• Enhancements in technologies of local area network and workstation have given rise
to group design type applications fulfilling the need for OODBMS.
• An object is considered as the unit of transfer from server to client.
• In page server approach, we consider page as the unit of transfer from server to client.
• In 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 class to inherit the methods and variables and 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
• Data model: It is an organisation of the real world entities, restrictions on them, & the
relationships between the objects.
• Directed acyclic graph (DAG): It is a directed graph with no directed cycles. It is
formed by a collection of vertices and directed edges, each edge linking one vertex to
another.
• Inheritance: Inheritance is defined as the process where the behaviour and properties
of parent object are inherited by the child object.
• Multiple inheritance: The capability of class to inherit the variables and methods from
numerous superclasses is known as Multiple inheritance.
• Non-leaf classes: Non-leaf classes are abstract and can have further subclasses (child
classes).
• Persistent programming language: A programming language which is expanded by
means of constructs to manage persistent data is known as a persistent programming
language.
• Relationships: Relationships permit objects to consider each other and effect in
networks of inter-related objects.
16. ANSWERS
Self-Assessment Questions
1. Objects
2. False
3. Page server
4. True
5. Value
6. True
7. Encapsulation
8. False
9. False
10. State
11. Abstract
12. Relationships
13. False
14. Four
15. Instance
16. Inheritance
17. Colon
18. True
19. isa
20. True
21. Persistent programming language
22. True
Terminal Questions
1. The various architectural approaches of OODBMS include Distributed Client - Server
Approach, Data Access Mechanism, Object Clustering, and Heterogeneous Operation.
Refer Section 3 for more details.
2. Object oriented data model include various object oriented concepts such as attributes
& methods, objects & objects identifiers, class hierarchy & inheritance. Refer Section 6
for more details.
3. Type hierarchy allows the inheritance of both attributes & methods. The capability of
class to inherit the variables and methods from numerous superclasses is known as
Multiple inheritance. Refer Section 11 for more details.
4. A programming language which is extended with constructs to manage persistent data
is known as a persistent programming language. Refer Section 12 for more details.
5. An interface is used to illustrate the behaviour or ability of a class without performing
to a specific implementation. Refer Section 10 for more details.
17. REFERENCES
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.