overview of object-oriented concepts characteristics by vikas jagtap

38
Overview of Object-Oriented Concepts Characteristics BY VIKAS JAGTAP

Upload: vikas-jagtap

Post on 18-Jul-2015

95 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Overview of Object-Oriented Concepts Characteristics

BY VIKAS JAGTAP

Page 2: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

1.1 Overview of Object-Oriented Concepts Characteristics:Object-oriented data base systems are proposed as alternative

to relational systems and are aimed at application domains where complex objects play a central role.

The approach is heavily influenced by object-oriented programming languages and can be understood as an attempt to add DBMS functionality to a programming language environment

Page 3: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

The Object Database Management Group (ODMG) has developed a standard Object Data Model (ODM) and Object Query Language (OQL), which are the equivalent of the SQL standard for relational database system.

Object Relational Database Systems: Object-Relational Data Base Management System (ORDBMS), is a

database management system (DBMS) similar to a relational database, but with an object-oriented database model,

Page 4: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

objects, classes, inheritance and polymorphism are directly supported in database schemas and in the query language. In addition, it supports extension of the data model with custom data-types and methods.

• One aim for the Object-relational database is to bridge the gap between conceptual data modeling techniques such as Entity-relationship diagram (ERD) and object-relational mapping (ORM),

Page 5: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

which often use classes and inheritance, and relational databases, which do not directly support them.

Another, related, aim is to bridge the gap between relational databases and the object-oriented modeling techniques used in programming languages such as Java, C++, or C#.

Page 6: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Object oriented programming

Data Base capabilities

An OODB bridges gap between OOP & Data Base Technology

Inheritance

Data Encapsulation Object Identity

Polymorphism

Security

Integrity

versioning

Transactions

Persistence

Concurrency

Query

Recovery

Archive

Page 7: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

An object-relational DBMS allows software-developers to integrate their own types and the methods that apply to them into the DBMS.

ORDBMS technology aims to allow developers to raise the level of abstraction at which they view the problem domain.

This goal is not universally shared; proponents of relational databases often argue that object-oriented specification lowers the abstraction level.

Page 8: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Many SQL ORDBMS in the market today are extensible with user-defined types (UDT) and custom-written functions (e.g. stored procedures).

Some (e.g. Microsoft SQL Server) allow such functions to be written in object-oriented programming languages, but this by itself doesn't make them object-oriented databases; in an object-oriented database, object orientation is a feature of the data model.

Page 9: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Any product that adheres to the object-oriented aspects of SQL:1999 could be described as an object-relational database management product.

For example, IBM's DB2, Oracle database, and Microsoft SQL Server, make claims to support this technology and do so with varying degrees of success.

Page 10: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

1.2 Objects: An object is the basic building block of object-oriented programming.

Programmers developing a system model create object classes to represent each component of a system.

Those generic classes are then used to create specific instances of each object for use in the program.

Objects may interact with each other through the use of methods.

Page 11: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Examples: In an object-oriented personnel database, there might be a generic object class called "Employee."

Administrators may then create specific instances of that object for individual employees, such as "Bill Jones" and "Mary Evans.“

Users may then interact with those objects using methods

Page 12: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

For example: HR personnel might use the increase_salary(x) method to increase an employee's salary by $X. Mary would be given a $500 raise by invoking "Mary Evans"->increase_salary(500).

OID’s: In object database systems, data objects can be given an object

identifier (OID), which is some value i.e unique in the database across time.

The DBMS is responsible for generating OID’s,

Page 13: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

ensuring that an OID identifies an object uniquely over its entire life time.

• OIDs can be system generated and user defined.Reference Types: The reference types are used in order to refer to a particular

location in table.• Classes: A class defines the data values stored by, and the functionality

associated with, an object of that class.

Page 14: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

• One of the primary advantages of OO data modeling is this tight integration of data and behavior through class mechanism.

• Each object belongs to one, and only one, class.• An object is often referred to as an instance of a

class. • A class specification provides the external view of

the instances of that class.

Page 15: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

• A class has an extent (sometimes called an extension), which is the set of all instances of the class.

• Within an OODBMS, the class construct is normally used to define the database schema.

• Some OODBMS use the term type instead of class. The OODBMS schema defines what objects may be stored within the database.

Page 16: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Attributes: Attributes represent data components that make up the content

of a class. Attributes are called data members in the C++ programming language.

• Instance attributes are data components that are stored by each instance of the class. Class attributes (static data members in C++) are data values stored once for all instances of the class.

• Attributes may or may not be visible to external users of the class.

Page 17: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Attribute types are typically a subset of the basic data types supported by the programming language that interfaces to the OODBMS.

Typically this includes enumeration types such as characters and booleans, numeric types such as integers and floats, and fixed length arrays of these types such as strings.

The OODBMS may allow variable length arrays, structures (i.e., records) and classes as attribute types.

Pointers are normally not good candidates for attribute types since pointer values are not valid across application executions.

Page 18: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

An OODBMS will provide attribute types that support inter-object references.

OO applications are characterized by a network of inter-connected objects.

Object inter-connections are supported by attributes that reference other objects.

Other types that might be supported by an OODBMS include text, graphic, and audio.

Often these data types are referred to as binary large objects (BLOBS).

Derived attributes are attributes that are not explicitly stored but instead calculated on demand.

Page 19: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Derived attributes require that attribute access be in-distinguishable from behavior invocation

Behaviors: Behaviors represent the functional component of a class. • A behavior describes how an object operates upon its attributes and

how it interacts with other related objects. • Behaviors are called member functions in the C++ programming

language. • Behaviors hide their implementation details from users of a class.

Page 20: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Encapsulation: Classes are said to encapsulate the attributes and behaviors of their

instances.• Behavior encapsulation shields the clients of a class (i.e.,

applications or other classes) from seeing the internal implementation of a behavior.

• This shielding provides a degree of data independence so that clients need not be modified when behavior implementations are modified (they will have to be modified if behavior interfaces change).

• A class's attributes may or may not be encapsulated.

Page 21: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

• Attributes that are directly accessible to clients of a class are not encapsulated (public data members in C++ classes).

• Modifying the definition of a class's attributes that are not encapsulated requires modification of all clients that access them.

• Attributes that are not accessible to the clients of a class are encapsulated (private or protected data members in C++ classes).

• Encapsulated attributes typically have behaviors that provide clients some form of access to the attribute.

Page 22: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

• Modifications to these attributes typically do not require modification to clients of the class.

Inheritance: Inheritance allows one class to incorporate the attributes and

behaviors of one or more other classes. A subclass is said to inherit from one or more super classes. The subclass is a specialization of the super class in that it adds

additional data or behaviors, or overrides behaviors of the super class.

Page 23: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Super classes are generalizations of their subclasses. Inheritance is recursive. A class inherits the attributes and behaviors from its super classes,

and from its super class's super classes, etc.In a single inheritance model, a class may directly inherit from only

a single other class.In a multiple inheritance model a class may directly inherit from

more than one other class.

Page 24: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Systems supporting multiple inheritance must specify how inheritance conflicts are handled.

Inheritance conflicts are attributes or behaviors with the same name in a class and its superclass, or in two superclasses.

Inheritance is a powerful OO modeling concept that supports reuse and extensibility of existing classes.

The inheritance relationships between a group of classes define a class hierarchy.

Page 25: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Class hierarchies improve the ability of users to understanding software systems by allowing knowledge of one class (a super class) to be applicable to other classes (its subclasses).

Polymorphism: Polymorphism allows the same operator or symbol to have

different implementations, depending on the type of objects to which the operator is applied.

Page 26: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

• Polymorphism and dynamic binding allow one to define operations for one object and then to share the specification of the operation with other objects.

• These objects can further extend this operation to provide behaviors that are unique to those objects.

• Dynamic binding determines at runtime, which of these operations is actually executed, depending on the class of the object requested to perform the operation.

Page 27: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

• Polymorphism and dynamic binding are powerful object-oriented features that allow one to compose objects to provide solutions without having to write code that is specific to each object.

• All of these capabilities come together synergistically to provide significant productivity advantages to database application developers.

Page 28: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

DATABASE DESIGN FOR ORDBMS: The main objective of ORDBMS design was to achieve the

benefits of both the relational and the object models such as scalability and support for rich data types.

ORDBMSs employ a data model that attempts to incorporate OO features into RDBMSs.

All database information is stored in tables, but some of the tabular entries may have richer data structure, termed abstract data types (ADTs).

Page 29: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

An ORDBMS supports an extended form of SQL called SQL3 that is still in the development stages.

The extensions are needed because ORDBMSs have to support ADT's.

The ORDBMS has the relational model in it because the data is stored in the form of tables having rows and columns and SQL is used as the query language and the result of a query is also table or tuples (rows).

Page 30: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

But the relational model has to be drastically modified in order to support the classic features of object-oriented programming.

Hence the characteristics of an ORDBMSs are: Base data type extension Support complex objects, Inheritance, and Rule Systems.

Page 31: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

ORDBMS allow users to define data types, functions and operators. As a result, the functionality of the ORDBMSs increases along with

their performance. An example schema of a student relation which ORDBMS supports

is : STUDENT (fname,lname,ID,sex,major,address,dname,location,picture).

Page 32: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

The extra attributes "location" and "picture" which are not present in the traditional EMPLOYEE relation of RDBMS. The data type of "location" is "geographic point" and that of "picture" is "image“ are included in ORDBMS.

Page 33: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

1.4 Comparing RDBMS,OODBMS & ORDBMS:

Criteria RDBMS OODBMS ORDBMS

Defining standard

SQL2 ODMG-2.0

SQL3 (in process)

Support for object-oriented features

Does not support; It is difficult to map program object to the database

Supports extensively

Limited support; mostly to new data types

Usage Easy to use OK for programmers; some SQL access for end users

Easy to use except for some extensions

Page 34: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Support forComplexrelationships

Does not support abstractdata types

Supports a wide variety ofdata types and data withcomplex inter-relationships

SupportsAbstractData typesAndComplexRelationships

Performance Very good performance Relatively less performanceExpected toperform verywell

Productmaturity

Relatively old and so verymature

This concept is few years oldand so relatively mature

Still inDevelopmen

tstage soimmature.

The use ofSQL Extensive supports SQL

OQL is similar to SQL, but withadditional features like Complexobjects and object-orientedfeatures.

SQL3 isBeingDevelopedwith OOFeaturesIncorporatedin it

Page 35: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

Advantages

Its dependence on SQL,relatively simple queryoptimization hence goodPerformance

It can handle all types ofcomplex applications,reusabilityof code, less coding

Ability toQueryComplexApplicationsand abilityTohandle largeAndcomplexApplications

Disadvantages Inability to handle complexApplications

Low performance due tocomplex query optimization,inability to support largescaleSystems

LowPerformancein webApplications

Support fromvendors

It is considered to be highlysuccessful so the marketsize isvery large but many vendorsaremoving towards ORDBMS

Presently lacking vendorsupport due to vast size ofRDBMS market

All majorRDBMSvendors areafter this sohas verygood future

Page 36: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

The main advantage of ORDBMSs is their massive scalability. Oracle8, released by Oracle Corporation, is designed to manage

large amounts of information. Oracle8 is expected to help NASDAQ manage its Very Large Data

Bases, VLDBs, which contain hundreds of gigabytes of time series applications are required by traders and analysts to examine trends on stock data.

In spite of many advantages, ORDBMSs also have a drawback.

Page 37: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

The architecture of object-relational model is not appropriate for high-speed web applications.

However, with advantages like large storage capacity, access speed, and manipulation power of object databases, ORDBMSs are set to conquer the database market.

The support from major DBMS vendors and its features will make ORDBMSs the market leader.

Page 38: Overview of Object-Oriented Concepts Characteristics by vikas jagtap

The International Data Corporation (IDC) also expresses the opinion that the ORDBMS market will surpass the size of the

ODBMS market in next three years.