Explain object oriented programming..

  SHORT SENTENCE OF OOP: 

1) EMPHASIS IS ON DATA RATHER THAN PROCEDURE , MEAN OBJECT DRIVEN

2)MAIN FOCUS IS ON THE DATA

3)BOTTOM UP APPROCH IN PROGRAM DESIGN

4)DATA IS HIDDEN AND CANNNOT BE ACCESSED BY EXTERNAL FUNCTIONS.

5)ADDING OF DATA AND FUNCTION IS EASY.

6)WE CAN USE NAMESPACE DIRECTLY.....Ex- using namespace std;

7)EXAMPLE:C++ , JAVA ,C#,ETC.....

                                           


BASIC CONCEPTS:

1] OBJECT:

*An object is an an instance of a class.

*An object means anything from real world like as person, computer, bench etc....

*Ever object has at least one unique identity.

*An object is a component of a program that knows how to interact with other pieces of the    program.

*Example: If water is class then river is object.

                                     


2]CLASS:

*A class is a template that specifies the attributes and behavior of  things or object.

*A class is blueprint or prototype from which objects are created.

*A class is the implementation of an abstract data type.

*Example: 


  

            class employee                             // class

            {

                                  char name[10];      //Data member

                                  int id;                    //Data member

                       public:    

                                   void getdata()      // Member function

                                   {

                                               cout<<"enter name and id of employee: ";

                                               cin>>name>>id;

                                    }

              }a;                                           //Object Declaration

*Object declaration can be also done in main() function as follows:

          int main()

          {

                employee a;

            }

3]DATA ABSTRACTION

*Just represent essential features without including the background details.

* They encapsulate all the essential properties of the objects that are to be created.

* The attributes are sometimes called 'Data member' because they hold information.

* The functions that operate on these data are sometimes called 'methods' or 'member functions'.

*It is used to implement in class to provide data security.

4]ENCAPSULATION:

*Wrapping up of a data and functions into single unit is known as encapsulation.

*In C++ the data is not accessible to the outside word.

*Only those functions can access it which is wrapped together within single unit.

5]INHERITANCE:

*Inheritance is the process , by which class can acquire the properties and methods of another class.

*The mechanism of deriving a new class from an old class is called inheritance.

*The new class is called derived class and old class is called base class.

*The derived class may have all the features of the base class.

*Programmer can add new features to the derived  class.

*Example: Student is a base class and Result is derived class.

6]POLYMORPHISM:

*A Greek word Polymorphism means the ability to take more that one form.

*Polymorphism allows a single name to be used for more than one related purpose.

*The concept of Polymorphism is characterized by the idea of 'one interface, multiple methods'.

*That means using a generic interface for a group of related activities.

*It means ability of operator and functions to act differently situation. 

*Example:

                 int total(int, int);  

                 int total(int, int, float);

6]STATIC BINDING:

*Static binding defines the properties of the variables at compile time. Therefore they can't be changed.

7] DYNAMIC BINDING:

*Dynamic binding means linking of procedure call to the code to be executed in response to the call.

*It is also known as late binding, because it will not binding the code until the time of call at run time. In other words properties of   the variables are determined at runtimes.

*It is associated with polymorphism and inheritance.

8]MESSAGE PASSING:

*A program contains set of object that communicates with each other.

*Basic steps to communicate

     1] Creating classes that define objects and their behavior.

     2] Creating objects from class definition.

     3] Establishing communication among objects.

* Message passing involves the object name , function name and the information to be sent.

   Example: employee.salary(name);

   In above statement employee is an object. salary is message, and name is information to      be sent.


BENEFITS OF OOP. :

1] We can eliminate redundant code through inheritance.

2] Saving development time and cost by using existing module.

3] Build secure program by data hiding.

4] It is easy to partition the work in a project based on object.

5] It can be easily upgraded from small ton large system.

6] It is easy to map objects in the problem domain to those in the       program.

7] Software complexity can be easily managed.

APPLICATIONS OF OOP:

1] Real-time systems

2] Simulation and modelling

3] Object oriented database

4] Artificial intelligence and expert systems 

5] Neural networks and parallel programming

6] Decision support and office automation 

7] CIM/CAM/CAD systems.

8] Distributed/Parallel/Heterogeneous computing

9] Data warehouse and Data mining/Web mining 




Comments