Advantages of Object Oriented Programming
As discussed in my previous post, Object Oriented Programming enables you to reuse various components of a program across programs. Reusability of codes not only saves time but also the effort of the programming team.
Some of the advantages of Object Oriented Programming include:
- Real world programming
- Reusability of codes
- Modularity of codes
- Information hiding
Let’s try and discuss each of these advantages in details.
- Real World Programming.
Consider the scenario to setup a business establishment with a basic structure. Over a period of time, you keep adding the various object required to extend the entire establishment. Similarly in OOP, you create a basic structure of a program and keep extending the functionality of the program as per the requirements. OOP approach models the real world more accurately than the conventional approach.
- Reusability of Codes
In OOP approach, you build classes that can be used by several applications. For example you are asked to develop two applications namely Hotel Management System and Hospital Management System. One of the modules in the Hotel Management System includes the Login and Authentication Process, because of the reusability capability of OOP, that same Login and Authentication module of the Hotel Management System can also be reused in the Hospital Management System as both applications require users to login before using the application. The reusability capability of OOP not only reduces the effort of recreating the components but also reduces the chances of introduction of errors in the various modules.
The benefit of reusability translates to saving time and effort, which in turn results in cost effectiveness.
- Modularity of Code
Another advantage of Object Oriented Programming is its Modularity. It means an object can be maintained independently of other objects. All these objects are independent of each other and are maintained separately. You can make modifications in the required object without affecting the functionality of other objects.
- information Hiding
Object provides the benefit of information hiding. Only a limited access to information is provided to the user. Information hiding ensures data security in a program. For example, when you log in to an e-mail application on the Internet, you can only access the login screen to provide the login ID and password. However, how the application authenticates your login ID and provides the access is completely hidden from you.