Page 16 - DCAP404 _Object Oriented Programming
P. 16
Unit 1: Review of Object-oriented Programming
Notes
Figure 1.6: Relationship of Data and Functions in Procedural Programming
Global data items
Function-1 Function-3
Function-2 Function-4
Function-5
Did u know? What is the basic feature of Procedural-oriented Programming?
The basic feature of Procedural-oriented Programming is to reuse the same code at different
places in the program without coping it.
Another serious drawback with the procedural approach is that it does not model real world
problems very well. This is because functions are action-oriented and do not really correspond
to the elements of the problem.
Some characteristics exhibited by procedure-oriented programming are:
1. Emphasis is on doing things (algorithms).
2. Large programs are divided into smaller programs known as functions.
3. Most of the functions share global data.
4. Data move openly around the system from function to function.
1.3.2 Object-oriented Programming Paradigm
The term Object-oriented Programming (OOP) is widely used, but experts do not seem to agree
on its exact definition. However, most experts agree that OOP involves defining Abstract Data
Types (ADT) representing complex real-world or abstract objects and organizing programs
around the collection of ADTs with an eye toward exploiting their common features. The term
data abstraction refers to the process of defining ADTs; inheritance and polymorphism refer to
the mechanisms that enable you to take advantage of the common characteristics of the ADTs –
the objects in OOP.
Before going any further into OOP, take note of two points. First, OOP is only a method of
designing and implementing software. Use of object-oriented techniques does not impart
anything to a finished software product that the user can see. However, as a programmer while
implementing the software, you can gain significant advantages by using object-oriented
methods, especially in large software projects. Because OOP enables you to remain close to the
conceptual, higher-level model of the real world problem you are trying to solve, you can
manage the complexity better than with approaches that force you to map the problem to fit the
features of the language. You can take advantage of the modularity of objects and implement the
LOVELY PROFESSIONAL UNIVERSITY 9