Advantages of Object-Oriented Programming

How it is Different from Object Based Programming?

Harsh Gupta - Tech Writer
OOP emulates the real world in a software system. The real world consists of objects that can be categorized in different classes. Some of the advantages of object-oriented programming include:

Real-world programming

Reusability of code

Modularity of code

Resilience to change

Information hiding

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 objects 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.

Reusability of Code

In the object-oriented approach, you build classes, which can be used by several applications. The concept can be explained by using the following analogy.

As a strategic intervention of revamping their existing products and processes, the management of BeautylnFitness has decided to automate their existing systems using a staggered approach. The automated sales system is the first process to be implemented. The system enables the management to analyze the sales data and build strategies for the products. In addition, the automated system also tracks salesperson-wise data to provide incentives to the high performers.

Over a period of time, the management decides to extend the functionality of the automated system to the purchase department. In addition, the various modules to be added for the system must take care of the finance and Personnel departments.

In this scenario, one of the most common entities is the employee of the organization. In the existing automated system, the programmer has already created a component that stores the details of an employee. Therefore, the programmer need not recreate the entire component again. The employee component of the sales automation system can be used to track the details of the employees across departments, including the payroll division of the Personnel department.

In the Personnel department, the automated system needs to keep track of employees. In addition to the regular employees, the Personnel department needs to keep track of the contract employees who join the organization temporarily for a specific period.

To store the employee details, the system again requires the employee component. However, to store the details of the contract employees, the programmer can extend the functionality of the existing employee component and make the desired changes in the existing component.

The finance department needs to make payments against various payouts, salaries, and wages of the employees. In this module too, the programmer can reuse the existing components, such as, employee and contract employees.

The reuse of the components once created not only reduces the effort of recreating the components, but also reduces the chances of introduction of errors in various modules. After integrating all the modules) a consolidated system can be created that has various components reused across the modules.

The benefit of reusability translates to savings in time and effort, which in turn results in cost effectiveness.

Modularity of Code

Another advantage of object-oriented programming is its modularity. It means that 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.

Resilience to Change

Object-oriented programming also enables you to evolve various versions of software. When a change is suggested, the old system need not be completely abandoned and re-built from scratch. For example* the payroll system of BeautylnFitness has been developed using object-oriented techniques.

The growth rate of the organization has rendered the old payroll system inadequate. The organization today has a mix of employees on the payroll, contract workers, and external consultants.

The original payroll system was designed for employees of two types-confirmed employees and trainees. Though there are many attributes that are common between confirmed employees and trainees, such as name and address, there are some attributes that are different. For example, a confirmed employee receives basic pay while a trainee receives a stipend.

The organization wants the system to be modified to accommodate freelancers as well. In the object-oriented system, this change does not mean that the entire payroll system needs to be reorganized. A new type of employees as freelancers needs to be introduced to take care of all activities related to freelancers. With the help of resilience feature of OOP, this new change can be introduced without affecting the earlier code or application.

Resilience to change enables easier maintenance of the program. For the same reason, even during construction, parts of the system under development can be refined without any major change in other parts.

Information Hiding

Objects provide the benefit of information hiding. Only a limited access to information is provided to the user. Information hiding ensures data security in a program. An end-user is given an access to the essential details only hiding the complex and no-essential details that user might not be aware of. Information hiding is necessary to keep the user away from the complex part of the application or a program. This way the application appears to be simple and also security is maintained.

Information hiding is done using abstraction and encapsulation. If encapsulation then abstraction.

Published by Harsh Gupta - Tech Writer

I am a part time freelancer and writing is my hobby Some of my websites: http://www.GenericArticles.com http://www.JailBreakingiPhone.com  View profile

  • Information hiding is done using abstraction and encapsulation. If encapsulation then abstraction
  • Another advantage of object-oriented programming is its modularity.
  • In OOP, you create basic structure of program & keep extending the functionality of program.
Everything in this World is an object. However, Object doesn't exist. Object exists in impure form in terms of class and instance. Class is the logical concept and instance is the physical concept.

To comment, please sign in to your Yahoo! account, or sign up for a new account.