Thursday 13 June 2013

Procedure oriented vs object oriented programming

Procedure oriented programming basically consists of writing a list of instructions (or actions) for the computer to follow, and organizing these instructions into groups known as functions. We normally use a flowchart to organise these actions and represent the flow of control from one action to another.
A serious drawbacks with the procedural approach is that, it does not model real world’s problem very well. This is because, functions are action oriented and do not really correspond to the elements of the problem.
Some characteristics of procedure oriented approach are:
  • Emphasis is on doing things (algorithm)
  • large programs are divided into smaller programs known as functions.
  • Most  of functions share global data
  • Data move openly around the system from function to function
  • Functions transfer, data from one form to another
  • Employs top- down approach in program design.
Object oriented Programming
Object oriented programming treats data as a critical elements in the program development and does not allow it to flow freely around the system. OOP allows decomposition of a problem into a number of entities called objects and than builds data and function around these objects.
Some of the features of OOP are:
  • Emphasis is on data rather than procedure
  • Program are divided into objects
  • Data structures are designed such that they characterised the objects
  • functions that operate on the data of an objects are tied together in  a data structure
  • Data is hidden and cannot be accessed by external functions.
  • objects may communicate with each other through functions.
  • New data and functions, can be easily added whenever necessary
  • follows bottom up approach

No comments:

Post a Comment