Site icon i2tutorials

CPP- How OOP differ from POP

How OOP differ from POP

 

The program and the data are two basic components of any computations. Among these, data plays an important role and it can exist without a program, but a program has no relevance without data.

The high-level languages stress the algorithms used to solve a problem. When the data is defined as global, then the data is available for all functions of a program without any restriction. This method has reduced data security and integrity since complete data became available to all functions and any function may modify any data.

 

Unlike the traditional methodology (POP), OOP emphasized the data rather than the algorithm. In OOPs, the data is encapsulated with the associated functions and this compartment is referred to as an object. In the OO approach, the problem is divided into objects, whilst in POP the problem is divided into functions.

OO languages are used to locate data and code and prevent other objects from referring to their local area. OOP focuses on the concepts of objects, encapsulation, inheritance, polymorphism, message communication, and so on.

 

While executing a program, objects interact with one another by sending messages and receiving responses. For example, in an account withdrawal plan, a customer item may send a withdrawal message to a bank account item. An object communicating with other objects need not be aware of the internal functioning of the objects with which it interacts. The inner structure of the object is completely hidden to the user and this property is called data/information hiding or data encapsulation.

 

Exit mobile version