OOP Introduction & Advantages
OOP Introduction & Advantages
What is OOP?
OOP is a design philosophy. It stands for Object Oriented Programming. Object-
Oriented Programming (OOP) uses a different set of programming languages than old
procedural programming languages (C, Pascal, etc.). Everything in OOP is grouped as self-
sustainable "objects". Hence, its gain reusability by means of four main object-oriented
programming concepts.
To clearly understand the object orientation model, let’s take your “hand” as an example. The
“hand” is a class. Your body has two objects of the type "hand", named "left hand" and "right
hand". Their main functions are controlled or managed by a set of electrical signals sent
through your shoulders (through an interface). So, the shoulder is an interface that your body
uses to interact with your hands. The hand is a well-architected class. The hand is being reused
to create the left hand and the right hand by slightly changing the properties of it.
Why OOP!
Object Oriented Programming refers to a programming methodology based on objects,
instead of just functions and procedures. These objects are organized into classes, which allow
individual objects to be group together. Most modern programming languages including
Java, C++, and PHP, are object-oriented languages, and many older programming languages
now have object-oriented versions. One of the principal advantages of object-oriented
programming techniques over procedural programming techniques is that they enable
programmers to create modules that do not need to be changed when a new type of object
is added.
Classic “procedural” programming languages before C++ (such as C) often focused on the
question “What should the program do next?” The way you structure a program in these
languages is:
Consider the task of modeling the operation of a car. Such a program would have lots of
separate variables storing information on various car parts, and there’d be no way to group
together all the code that relates to, say, the wheels. It’s hard to keep all these variables and
the connections between all the functions in mind.
To manage this complexity, it’s nicer to package up self-sufficient, modular pieces of code.
People think of the world in terms of interacting objects: we’d talk about interactions between
the steering wheel, the pedals, the wheels, etc. OOP allows programmers to pack away details
into neat, self-contained boxes(objects)so that they can think of the objects more abstractly
and focus on the interactions between them.
Advantages of OOP:
OOP provides a clear modular structure for programs.
It is good for defining abstract data types.
Implementation details are hidden from other modules and other modules has a
clearly defined interface.
It is easy to maintain and modify existing code as new objects can be created with
small differences to existing ones.
Objects, methods, instance, message passing, inheritance are some important
properties provided by these particular languages.
Encapsulation, polymorphism, abstraction are also counts in these fundamentals of
programming language.
It implements real life scenario.
In OOP, programmer not only defines data types but also deals with operations
applied for data structures.