Advantages of OOP
OOP provides advantages over traditional structural programming languages. OOP facilitates writing applications by turning real-world objects into code components. OOP enables users to model real-world objects. Modeling means representing real-world objects as components in Java. Object-Oriented Programming allows programmers and customers to use the same terminology to explain the business domain and the program.
In Summary:
Enables the use of real-world modeling
Promotes the reuse of code
Provides flexibility in the modification of an existing application
Helps with the maintainability of code.
Let’s go in detail with the advantages…
Enables the use of real-world modeling
Consider an example. A car is an object that has specific attributes, such as an engine and wheels. Using OOP principles, you would model the car as a car object in Java that would have the same properties.
Creating applications that model the real world closely enables developers to understand an application faster than any other applications. Therefore, an application that implements OOP concepts effectively is implemented and used.
Promotes the reuse of code
Another advantage of OOP is that it promotes the reuse of code. The code used to define an object can be shared by several objects of an application. For E.g.: the code used to design a type of car can be used for designing different types of cars. This saves you from rewriting code for various types of cars. A benefit of code reuse is that it reduces the amount of code to write, debug, test, and possibly upgrade in the future.
Provides flexibility in the modification of an existing application
OOP promotes flexibility in the design and implementation of a solution. Maintenance and upgrades are seen as further cycles in application development. By using OOP practices, applications become easier to extend.
Consider an example of XYZ Corporation. The application used by the production department of this organization is currently designated to create two types of chairs, plastic and metal. To meet the demands of its customers, the organization decides to produce wooden chairs as well. To meet the change in the requirement, the XYZ
corp. needs to incorporate changes into its current application system. If the current system was built using OOP best practices, extensions to the system may be simplified. For Eg: the new chair type would be able to share or reuse some of the other chair types’ code.
Helps with the maintenance of Code
Finally, OOP helps in the maintenance of code. By using OOP, you can create separate components for different requirements. In OOP, a component is known as a class. For example, to design a payroll system of an organization, you could create classes such as Employee and Payroll. By creating the Employee and the Payroll classes, information related to each class can be segregated. An internal change in one of these classes should not affect the functionality of the other class. Therefore, the maintenance of a system is simplified by reducing dependencies in between classes.
OOP Design Principles
An application that implements Object-Oriented Programming (OOP) concepts is distinguished by four design principles. The four design principles are encapsulation, abstraction, inheritance, and polymorphism.
Encapsulation
Encapsulation hides the inner workings of an object from outside users of the object. This protects outside users from making internal changes or optimizations to such objects. The object needs only to maintain its external functionality to support its clients. Internal details, such as data representation, should not be accessible externally.
Abstraction
The principle of abstraction is modeling real-world objects as objects in Java. However, these objects are only modeled at a certain level of detail. Only the behavior and data that is needed by your application will be included in your model.
The abstraction design principle focuses on the essential characteristics of an object. In OOP, abstraction defines the conceptual boundaries of an object. These boundaries distinguish one type of object from another
Inheritance
The inheritance design principle allows a class to inherit the characteristics of another class. When inheritance is used in an application, the application consists of classes that are arranged in hierarchies. The classes defined at the lower levels of a hierarchy inherit from the classes higher up in the hierarchy.
By creating a hierarchy of classes, the characteristics and code of a class are made reusable. A class can inherit characteristics from other classes and provide additional features. The new class has its own attributes and the attributes of the existing class. This feature provides extensibility and reusability in classes.
Polymorphism
Polymorphism refers to the ability of an object to take on different forms depending upon the situation. Consider an example of a class Sedan that inherits from the class Car that inherits from the class Vehicle. An instance of the Sedan class can be referred to as a Sedan, a Car, or a Vehicle.
Polymorphism provides flexibility to an application based on requirements. It simplifies coding and reduces the rework involved in developing and modifying an application. This is because different types of objects can react to the same type of stimulus.
Related Post:
Inheritance | Polymorphism | Encapsulation



29 responses so far ↓
OOPS Concepts « Bhuvana Sundaramoorthy’s Blog // November 9, 2006 at 3:01 am
[...] 1. Introduction 2. Inheritance 3. Polymorphism 4. Encapsulation What is an Object? An object is a software bundle of related state and behavior. Software objects are often used to model the real-world objects that you find in everyday life.Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). [...]
gurukamepalli // December 12, 2006 at 3:30 pm
hi this guru
Hitesh Khatri // January 14, 2007 at 8:26 am
Its is good material to clear the concept of OOPS
boopathi // February 3, 2007 at 4:06 pm
pls send me material about OOPS concept, im keen to learn this concept
boopathi // February 3, 2007 at 4:06 pm
boopathikm@gmail.com
Ganeshkumar // February 8, 2007 at 4:25 am
Plese send me the materials for OOPS concept as i am interested in it for studying
Ganeshkumar // February 8, 2007 at 4:28 am
kgk19852002@yahoo.com
bhuvans // February 8, 2007 at 5:24 am
@boopathi ,Ganeshkumar
You can subscribe to the blog…
http://www.feedblitz.com/f/?Sub=141315
It will send you the post to you email address
OOP Concept - Inheritance « IDYN Solutions // February 8, 2007 at 7:24 am
[...] it results in the execution of method displayDetails from Vehicle. Related Post: Introduction to OOP | Polymorphism | [...]
OOP Concept - Encapsulation « IDYN Solutions // February 8, 2007 at 7:32 am
[...] can directly access the parent’s protected attributes without using operations. Related Post: Introduction to OOP | Inheritance | [...]
Nishana // April 15, 2007 at 6:15 am
hi please send me the full concept of oops
nmm // May 7, 2007 at 5:34 am
more detail about abstract class is required
nmm // May 7, 2007 at 5:35 am
more infomation about abstract class is required thank u
pkalpana // June 3, 2007 at 8:26 am
i need more information about OOP’s concepts please..can u send it to kalpanareddy@gmail.com
Vijay Bhaskar.V // June 25, 2007 at 7:23 pm
Hi I’m new to softwate and I want to learn about OOPs, please send basic info on OOPs to vanam8@gmail.com.
yogi // July 27, 2007 at 12:51 pm
see this
imthiyaz // July 27, 2007 at 12:54 pm
can u give some realtime example about polymorphism
padmavathi // August 3, 2007 at 3:04 am
Hi, send me send me the full concept of oops
padmavathi // August 3, 2007 at 3:06 am
Hi, please send me Full material for OOPs concepts
srinivas // August 23, 2007 at 11:31 am
hi,
i want lern java
plz send full materials bout core java,sevlets,jsp&struts
vijayphalake // October 1, 2007 at 6:15 am
Please send me other articals on OOP concetps
joe98 // October 30, 2007 at 6:11 am
it’s gud…but cn u tell me smthng abt….instance methods &instance variables
P.Raja // February 1, 2008 at 12:17 pm
very good notes
rakesh // February 3, 2008 at 5:30 am
why do u want to do a job
OOP Concept & Programming « // June 13, 2008 at 5:01 am
[...] OOP CC6 [...]
Praveen Kumar // August 22, 2008 at 11:43 am
Please send me material of oops concept
saravana // August 22, 2009 at 3:11 pm
send the materials for OOPs concepts
saravana // August 22, 2009 at 3:15 pm
Hi, send me send me the full concept of oops
akhilesh // September 23, 2009 at 1:15 pm
pls send me a full ooops concept interview question..