Object-Oriented Programming (OOP), Its Pillars & Its Characteristics
It is the programming style that is based on the concept of :
Class is the blueprint of an object. It defines the attributes of the objects and what operations can be performed.
These are the behaviors of the class which contains the process of any work done.
Pillars or Elements of Object-Oriented Programming
Inheritance is the technique where a new class can be created out of an existing class.
A Child class from a Parent class is created such that it inherits the properties and methods of the parent class and can have its own additional properties and methods.
It refers to, providing only essential information to the outside world and hiding their background details and implementation
A real-world example can be a calculator where the results of calculations are shown without showing how it is done.
Types of Abstraction
Data Abstraction: It is the technique in abstraction where fewer details are shown to the outer world. For example, if privacy is strong in someone’s Facebook profile, we are able to see a few details, and the features like about, photos cannot be seen.
Process Abstraction : It is the technique in abstraction where the implementation or functions are not shown to the outer world. While changing gear in a car we don’t have to worry about engine-level mechanics.
Encapsulation is a process of binding data members (variables, properties) and member functions (methods) into a single unit. It is also a way of restricting access to certain properties or components. The best example of encapsulation is a class.
It is the ability of an object to take many forms. It occurs when a parent class reference is used to refer a child class object.
Advantages & Disadvantages of OOP
Usability of Code :Inheritance allows to re use the parent class codes
Data Security : Abstraction & Encapsulation helps to hide the vulnerable data to the outside world
Real World Models : Through the class , object and methods it is very easy to actualize the real world examples in the code.
Tricky Designs : Some time , it’s hard to design the models of objects and can be a bit tricky
Over Generalised Classes : The design sometimes make the classes over generalized.
Need of Both Coding & Planning skills: The OOP Concept demands a developer with both programming as well as software engineering skills.
Subscribe to our Youtube ChannelSubscribe