Dbms PPT
Dbms PPT
GROUP-01
DATABASE
MODELS Types of Database Models:
Advantages
Specialization
Database Integrity
Poor Flexibility
Communication Barriers
Organizational Disunity
Object oriented data model is based upon real world situations. These situations are
represented as objects, with different attributes. All these object have multiple relationships
between them.
Objects
Class
Inheritance
Elements of Object oriented data model
Objects : The real world entities and situations are represented as objects in the Object
oriented database model.
Attributes and Method : Every object has certain characteristics. These are represented using
Attributes. The behaviour of the objects is represented using Methods.
Class : Similar attributes and methods are grouped together using a class. An object can be
called as an instance of the class.
Inheritance : A new class can be derived from the original class. The derived class contains
attributes and methods of the original class as well as its own.
Example
Let us consider an Employee database to understand this model better. In this database we
have different types of employees – Engineer, Accountant, Manager, Clerk. But all these
employees belong to Person group. Person can have different attributes like name, address,
age and phone. What do we do if we want to get a person’s address and phone number? We
write two separate procedure sp_getAddress and sp_getPhone.
What about all the employees above? They too have all the attributes what a person has. In
addition, they have their EMPLOYEE_ID, EMPLOYEE_TYPE and DEPARTMENT_ID attributes
to identify them in the organization and their department. We have to retrieve their
department details, and hence we sp_getDeptDetails procedure. Currently, say we need to
have only these attributes and functionality.
Example
Since all employees inherit the attributes and functionalities of Person, we can re-use those
features in Employee. But how do we do that?
We group the features of person together into class. Hence a class has all the attributes and
functionalities. For example, we would create a person class and it will have name, address, age
and phone as its attribute, and sp_getAddress and sp_getPhone as procedures in it.
The values for these attributes at any instance of time are object. i.e. ; {John, Troy, 25,
2453545 : sp_getAddress (John), sp_getPhone (John)} forms on person object. {Mathew, Fraser
Town, 28, 5645677: sp_getAddress (Mathew), sp_getPhone (Mathew} forms another person
object.
Example
Now, we will create another class called Employee which will inherit all the functionalities of
Person class. In addition it will have attributes EMPLOYEE_ID, EMPLOYEE_TYPE and
DEPARTMENT_ID, and sp_getDeptDetails procedure. Different objects of Employee class are
Engineer, Accountant, Manager and Clerk.
Example
Example
Here we can observe that the features of Person are available only if other class is inherited
from it. It would be a black box to any other classes. This feature of this model is called
encapsulation. It binds the features in one class and hides it from other classes. It is only visible
to its objects and any inherited classes.
ADVANTAGES
● Because of its inheritance property, we can re-use the attributes and functionalities. It
reduces the cost of maintaining the same data multiple times. Also, these informations
are encapsulated and, there is no fear being misused by other objects. If we need any new
feature we can easily add new class inherited from parent class and adds new features.
Hence it reduces the overhead and maintenance costs.
● Because of the above feature, it becomes more flexible in the case of any changes.
● Codes are re-used because of inheritance.
● Since each class binds its attributes and its functionality, it is same as representing the
real world object. We can see each object as a real entity. Hence it is more
understandable.
DISADVANTAGES
● It is not widely developed and complete to use it in the database systems. Hence it is not
accepted by the users.
● It is an approach for solving the requirement. It is not a technology. Hence it fails to put it
in the database management systems.
THANKS