The object oriented programming has been developed with a view to overcome the drawbacks of conventional programming approaches. The OOP approach is based on certain concepts that help it attain its goal of overcoming the drawbacks of shortcomings of conventional programming approaches. These general concepts of OOP are given below:
Also Read: How to write and run c/c++ programs in Ubuntu
1. Data Abstraction
Abstraction refers to the act of representing special features without including the background details or explanation.
The wrapping up of data and operations/functions (that operate on the data) into a single unit (called class) is known as encapsulation.
Modularity is a property of a system that has been decomposed into a set of cohesive and loosely coupled modules.
Inheritance is the capability of one class of things to inherit capabilities or properties of another class.
Polymorphism is the ability for a message or data to be processed in more than one form.
Advantages of OOP
- It models real world well.
- With OOP, programs are easy to understand.
- OOP offers classes reusability. Already created classes can be reused without having to write them again.
- OOP facilitates Quick Development as parallel development of classes is possible.
- With OOP, programs are easier to test manage and maintain.
Disadvantages of OOP
- With OOP, classes tend be overly generalised.
- The relations among classes become artificial at times.
- The OOP programs design is tricky.
- Also one needs to do proper planning and proper design for OOP programming.
- To program with OOP, programmer need proper skills such as design skills, programming skills, thinking in terms of objects etc.
Source: Text Book: C++ Sumita Arora