Tuesday 12 February 2013

Object Oriented Programming - Basic Concepts for Beginers



Object oriented Program development is a new programming style having real world thinking. It is not a programming technique. So each and every programmer has his own way of thinking. To standardize the thinking the following characteristics are defined.

1) Object
2) Class
3) Data abstraction
4) Data encapsulation
5) Inheritance
6) Polymorphism
7) Dynamic binding
8) Message passing

1) Object

An object is defined as an entity that contain data and its related functions. The functions operate on that data. The objects may be either physical or logical.

2) Class

A class is defined as a collection of objects with same type of data and fuctions. The fuctions of the class should be defined. With the help of the class we can create number of objectsof type class. All objects occupies equal memory size.

3) Data abstraction

Abstraction is defined as a grouping of essential details and ignoring other details.

Data abstraction is defined as a named collection of data that describes a data object in a class. For example cost, size weight and colour are all named collection of data that describes the object chair in the class furniture.

Class is also called abstract data type because classes use the principle of data abstraction.

4) Data encapsulation

Encapsulation is a technique used to protect the information in an object from other objects.
In an object data and its functions are encapsulated into a single entity. Because of this other objects and programs cannot access the data in an object directly. This concept is called data encapsulation or data hiding.

5) Inheritance

Inheritance is a process of deriving new classes from existing classes. The derived classes contains all attributes and functions of exiting classes plus its own attributes and fuctions.

6) Polymorphism

Polymorphism is a technique used to write more than one function definition with same function name. The functions may be in the same class or in different derived classes.

7) Dynamic binding

Binding is defined as the connection between the function call and its corresponding program code to be executed. There are two type of binding. They are
a) Static binding - In static binding, the binding occures during compilation time.
b) Dynamic binding - In dynamic binding, the binding occures during run time. This is also called late binding.

8) Message Communication

Message communication is defined as a process of sending a request to execute a function for an object. The general form is

object_name.message(info);


0 comments:

Post a Comment

Powered by Blogger.