A LOOK AT PROCEDURE ORIENTED PROGRAMMING
Conventional programming, using high level languages such as COBOL,FORTRAN ,and c language, is commonly known as procedure-oriented programming(POP). in the procedure oriented programming approach, the problem is viewed as a sequence of things to be done such as calculating, printing and
reading. The number of functions are written to accomplish these all tasks.
and The primary focus in on the functions, A typically program structure for procedural programming approach is show below in the figure. The technique of hierarchical decomposition has been used to specify the tasks to be completed for solving a program as show in figure
Diagram
Procedure oriented programming approach basically consists of writing a list of instructions for the computer to follow, and organizing these instructions into a groups known as functions.
We generally use a flowchart to organize these actions and represent the flow of control one action to another.
whenever we concentrate on the development of functions, very little attention is given to data that are being used by various functions.
what happens to the data?
In a multiple function programs, many important data items are places as global so they may be access by all functions, and each (every) function may have its own local data.
in the below figure show the relationship of data and functions in a procedure oriented program
OBJECT-ORIENTED PROGRAMMING PARADIGM
The major motivation factor in the invention of object oriented approach is to remove some of flaws encountered in the procedural programming approach .
Object oriented programming treats data as a critical element in the program development and does’nt allow it to flow freely around the system.
It tries data more closely to functions that operate on it, and protects it from accidental modification from outside function. Object oriented programming system allows decomposition of a problem into a number of entities called objects and then builds data and functions.
around these objects. The data of an object can be accesses only by the functions associated with that object.
However, show in the below when functions of one object can access the functions of other objects
Some of the features of object oriented programming are below:
1. Emphasis is on data rather than procedure.
2. Program are divided into what are known as objects.
3. Data structure are designed such that they characterized the objects.
4. functions that are operate on the data of an object are tied together in the Ds (data structure).
5. Data is hidden and cannot be accessed by external functions only access by internal functions.
6. objects can communicate with each other through functions
7. new functions and data can be easily added whenever need
8. follows bottom to up approach in program design
Object oriented programming(OOPS) is the most recent concept amount programming paradigms and still means different things to different people.
it is therefore important to have a working definition of object oriented before we proceed further.
we define (OOPS) “object oriented programming” as an approach that provides a way of modularity programs by creating partitioned memory area for both functions and data that can be used
a template for creating copies of such modular on demand. thus an object is considered to be a partitioned area of computer memory that stores data set of
operations that can access that data.