Object Oriented Programming or OOP is a different approach of programming and has emerged as a new approach for software design and development.
Object Oriented Programming in computer science, is a type of high level computer language that uses self contained, modular instruction sets for defining and manipulating aspects of computer program.
OOP treats data as a critical element in the program development and does not allow it to flow freely around the system.
It ties data more closely to the functions that operates on it, and protects it from accidental modification from outside functions OOP 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 accessed only by the functions associated with that object. However, functions of one object can access the functions of other objects.
Organization of Data and Functions in OOP
Features of Object Oriented Programming:
- Emphasis is on data rather than procedure.
- Programs are divided into what are known as objects.
- Data structures are designed such that they characterize the objects.
- Functions that operate on the data are tied together in the 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 in program design.
Check out these programming books:
CHARACTERISTICS OF OBJECT ORIENTED PROGRAMMING OR OOP
An object is an entity with some characteristics and behavior. OOP allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects. Therefore objects are basic run-time entities in an object oriented programming.
A class is a collection of objects that share common characteristics and relationships. For example mango, apple and orange are said to be objects of class fruit. Thus we can say objects are variables of class. Once the class has been defined, we can create any number of objects belonging to that class.
Abstraction refers to the act of representing essential features without including the background details or explanations.
The wrapping up of data and functions together into a single unit (called class) is known as encapsulation. Data encapsulation is the striking feature of a class. The data is not accessible to the outside world but available only to those functions which are wrapped in the class. These functions provide the interface between the object’s data and the program This insulation of the data from the direct access by the program is called data hiding or information hiding.
Inheritance is the process by which objects of one class acquire the properties of objects of another class. It supports the concept of hierarchical classification. It is capability to define a new class in terms of an existing class. An existing class is known as base class and the new class is known as derived class.
Polymorphism essentially means having many forms. In C++, it is the ability for a message or data to be processed in more than one form.