Beruflich Dokumente
Kultur Dokumente
A Program can be written in both the languages, but if the task is highly complex, OOP
operates well as compared to POP.
In POP, the ‘data security’ is at risk as data freely moves in the program, as well as, ‘code
reusability’ is not achieved which makes the programming lengthy, and hard to understand.
Large programs lead to more bugs, and it increases the time of debugging. All these flaws
(faults) lead to a new approach namely “object-oriented programming”.
In object-oriented programming’s main concern is given on ‘data security’; it binds the data
closely to the functions which operate on it. It also resolves the problem of ‘code reusability’,
as if a class is created, its multiple instances (objects) can be created which reuses the
members and member functions defined by a class.
Comparison Chart
BASIS FOR
POP OOP
COMPARISON
Basis Main focus is on "how to get the task Main focus is on 'data security'.
done" i.e. on the procedure or Hence, only objects are permitted
structure of a program. to access the entities of a class.
Division Large program is divided into units Entire program is divided into
called functions. objects.
Entity accessing mode No access specifier observed. Access specifier are "public",
"private", "protected".
Data hiding & security There is no proper way of hiding the Data is hidden in three modes
data, so data is insecure public, private, and protected.
hence data security increases.
Data sharing Global data is shared among the Data is shared among the objects
functions in the program. through the member functions.
OOP’s main concern is to hide the data from non-member functions of a class, which it treats
like “critical information”. Data is closely tied to the member functions of a class, which
operates on it. It doesn’t allow any non-member function to modify the data inside it. Objects
communicate with each other through member functions to access their data.
Conclusion
The flaws (fault) of POP arises the need of OOP. OOP corrects the flaws (fault) of POP by
introducing the concept of “object” and “classes”. It enhances the data security, and
automatic initialization & clear-up of objects. OOP makes it possible to create multiple
instances of the object without any interference.
Differences between Procedural and Object oriented Language