This document discusses object-oriented databases and concepts. It covers topics like objects, classes, polymorphism, inheritance, and encapsulation. It also compares object-oriented and relational databases, describing advantages and disadvantages of each.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
33 views18 pages
Chapter 5
This document discusses object-oriented databases and concepts. It covers topics like objects, classes, polymorphism, inheritance, and encapsulation. It also compares object-oriented and relational databases, describing advantages and disadvantages of each.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18
Chapter 5
Object Oriented DBMS
Object Oriented Concepts An object-oriented database (OOD) is a database system that can work with complex data objects. OO concepts are applied in the areas of databases, software engineering, knowledge bases, artificial intelligence, and computer systems in general. An object typically has two components: state (value) and behavior (operations). Applications for OO databases include: Computer-aided design and manufacturing (CAD/CAM) Computer-integrated manufacturing (CIM) Computer-aided software engineering (CASE) Geographic information systems (GIS) Many applications in science and medicine Document storage and retrieval Cont.… Object-oriented databases closely relate to object-oriented programming concepts. The main ideas of object-oriented programming are: Object Class Polymorphism Inheritance Encapsulation 1. Objects Objects represent real world entities, concepts, and tangible as well as intangible things. For example a person, a licenses Objects are categorized by their type or class. An object is an instance of a type or class Characteristics of Object
Some important characteristics of an object are:
Object name: The name is used to refer different objects in the program. Object identifier: This is the system generated identifier which is assigned, when a new object is created. Transient object: In OOPL, objects which are present only at the time of execution are called as transient object. For example: Variables in OOPL Persistent objects: An object which exists even after the program is completely executed is called as persistent objects. Object-oriented databases can store objects in secondary memory 2. Class Classes are classified as lexical and non lexical classes. A lexical class contains objects that can be directly represented by their values. E.g. integer, string . A non lexical class contains objects each of which is represented by a set of attributes and methods E.g. person ,employee Each individual object is called an instance of its class 3. Polymorphism Polymorphism is the capability of an object to take multiple forms. This ability allows the same program code to work with different data types. For example Both a car and a motorcycle are able to break, but the mechanism is different. In this example, the action break is a polymorphism. 4. INHERITANCE Inheritance creates a hierarchical relationship between related classes. Where the child class inherit attributes and behaviors from their parent table. Defining new types inherits all the existing class fields and methods plus further extends them. For example, a parent class called Vehicle will have child classes Car and Bike. Both child classes inherit information from the parent class and extend the parent class with new information depending on the vehicle type 5. Encapsulation
Encapsulation is the way to restrict the direct access to some components
an object. Through this process, pieces of information and details of how an object works are hidden, resulting in data and function security. Classes interact with each other through methods without the need to know how particular methods work. As an example, a car has descriptive characteristics and actions. You can change the color of a car, yet the model or make are examples of properties that cannot change. A class encapsulates all the car information into one entity, where some elements are modifiable while some are not. Drawbacks of relational DBMS Relational databases are widely used in many industries to store financial records, keep track of inventory and to keep records on employees. In a relational database, information is stored in tables (often called relations) which help organize and structure data. Cost :- One disadvantage of relational databases is the expensive of setting up and maintaining the database system. In order to set up a relational database, you generally need to purchase special software. Structured Limits:- Some relational databases have limits on field lengths. When you design the database, you have to specify the amount of data you can fit into a field. Isolated Databases:- For example, the hospital billing department used one database while the hospital personnel department used a different database. Getting those databases to "talk" to each other can be a large, and expensive. OODBMS definitions An OODBMS is a database management system that supports the creation and modeling of data as objects. OODBMS also includes support for classes of objects and the inheritance of class properties, and incorporates methods, subclasses and their objects. An OODBMS applies concepts of OOP, and applies them to the management of persistent objects on behalf of multiple users, with capabilities for security, integrity, recovery and contention management. An OODBMS is based on the principles of “objects,” namely abstract data types, classes, inheritance mechanisms, polymorphism, dynamic binding and message passing. Components of Object-Oriented Data Model The OODBMS is based on three major components, namely: Object structure, Object classes, and Object identity. These are explained below. 1. Object Structure: • The structure of an object refers to the properties that an object is made up of. • These properties of an object are referred to as an attribute. The object structure is further composed of three types of components: Messages, Methods, and Variables. These are explained below. 1. Messages – A message provides an interface or acts as a communication medium between an object and the outside world. 2. Methods – When a message is passed then the body of code that is executed is known as a method. 3. Variables – It stores the data of an object. 2. Object Classes: • An object which is a real-world entity is an instance of a class. • Hence first we need to define a class and then the objects are made which differ in the values they store but share the same class definition. • The objects in turn correspond to various messages and variables stored in them. OO Data modeling and E-R diagramming E-R Model ER model • Is used to represent real life scenarios as entities. • The properties of these entities are their attributes in the ER diagram and their connections are shown in the form of relationships. • An ER model is generally considered as a top down approach in data designing. Advantages of E - R model The data requirements are easily understandable using an E - R model as it utilizes clear diagrams. The E-R model can be easily converted into a relational database. The E-R diagram is very easy to understand as it has clearly defined entities and the relations between them. Disadvantages of E-R model There is no data manipulation language available for an E- R model as it is a largely abstract concept. There are no standard notations for an E - R model. It depends on each individual designer how they design it. Object Oriented Model • Object oriented data model is based on using real life scenarios. • In this model, the scenarios are represented as objects. • The objects with similar functionalities are grouped together and linked to different other objects. Advantages of Object Oriented Model • Due to inheritance, the data types can be reused in different objects. This reduces the cost of maintaining the same data in multiple locations. • The object oriented model is quite flexible in most cases. • It is easier to extend the design in Object Oriented Model. Disadvantages of Object Oriented Model • It is not practically implemented in database systems as it is mostly a theoretical approach. • This model can be quite complicated to create and understand. Attributes: are nothing but the properties of objects in the system. Types of Attributes
The three types of attributes are as follows:
1. Simple attributes Attributes can be of primitive data type such as, integer, string, real etc. which can take literal value. Example: 'ID' is simple attribute and value is 07. 2. Complex attributes Attributes which consist of collections or reference of other multiple objects are called as complex attributes. Example: Collection of Employees consists of many employee names. 3. Reference attributes Attributes that represent a relationship between objects and consist of value or collection of values are called as reference attributes. Example: Manager is reference of staff object Properties of OID 1. Uniqueness: OID cannot be same to every object in the system and it is generated automatically by the system. 2. Invariant: OID cannot be changed throughout its entire lifetime. 3. Invisible: OID is not visible to user End Of this course