Tuesday, 17 July 2018

DIFFERENCE BETWEEN PROCEDURE ORIENTED PROGRAMMING AND OBJECT ORIENTED PROGRAMMING


ADVANTAGES AND DISADVANTAGES OF OOP


Advantages of OOP:
  • Through inheritance, we can eliminate redundant code and extend the use of existing.
  •  Information hiding and data abstraction increase reliability and helps the programmer to build secure programs that cannot be invaded by code in other parts of the program.
  • Dynamic binding increases flexibility by permitting the addition of a new class of objects without having to modify the existing code.
  • Inheritance coupled with dynamic binding enhances the reusability of a code thus increasing the productivity of a programmer.
  • Many OO languages provide a standard class library that can be extended by the users thus saving a lot of coding and debugging effort.
  • If is possible to have multiple instances of an object to co-exist without any interference.
  • It is easy to partition the work in a project based on objects.


DISADVANTAGES:
  • It is not suitable for small programs where functions can give more accurate and quick results
  • It requires complicated spadework before OOP becomes fully operative
  • Creation of object libraries and its maintenance is a tough job.
  • Requires the master over the software engineering and programming methodologies.
  • Benefits only in long run while managing large software projects.


Fundamentals of Object Oriented Programming


Fundamentals of Object Oriented Programming 
Introduction :
Object Oriented Programming is a new way of approaching the job of programming. Approaches to programming have changed dramatically since the invention of the computer in order to accommodate the increasing complexity of programs.Object Oriented Programming takes the best ideas of structured programming and combines them with powerful, new concepts that encourage you to look at the task of
programming in a new light. Object Oriented Programming allows you to easily decompose a problem into subgroups of related parts. Then you can translate these subgroups into self contained units called objects. All Object Oriented Programming language have three things in comm. These are objects, inheritance and polymorphism.
Differentiate between object oriented programming languages and structured Programming languages and state the advantages and disadvantages for using Object oriented programming languages. In structured or procedural languages a program consists of a series of Procedures / functions, and steps all tied together in a form of algorithm. Procedures / Functions are grouped together to from modules, the building block of structured Programming. In structured programming the problem is viewed as a sequence of things to be done such as reading, calculating and orienting. A number of functions are written to accomplish these tasks.

Features of structured programming language:
* Emphasis is on algorithm rather than data.
* Programs are divided into individual procedures (functions) that perform discrete tasks.
* Procedures are independent of each other as far as possible.
* Procedures have their own local data and processing logic.
* Most of the functions share global data and data move openly from function to function.
* Employs top-down approach in program design.
* Projects can be broken up into modules and programmed independently.
* Maintenance of a large software system is tedious and costly.

In object oriented programming the problem is decomposed into a number of entities called objects and then builds data and functions around these objects. OOP treats data as a critical element in the programming development and dose not allow it to flow freely around the system. It ties data more closely to the functions that operate on it and protects it from accidental modifications from outside  functions.

Features of object oriented programming language:
* Emphasis is on data rather than procedure.
* Programs are divided into what are known as objects.
* Data structures are designed such that they characterize the objects.
* Functions that operate on the data of an object are tied together in the data structure.
* Data is hidden and cannot be accessed by external functions and objects may communicate with each other through functions.
* Follows bottom-up approach in program design.