Fundamentals of Object-Oriented Programming

In this article, I have introduced the basic concepts of object-oriented programming and briefly discussed the benefits and applications of the OOP approach.

Unnati Shah
5 min readJun 5, 2023
image_credit — eduCBA

Java is an object-oriented language. It enables us not only to organize our program code into logical units called objects but also to take advantage of encapsulation, inheritance, and polymorphism. With the advent of languages such as C, structured programming became very popular and was the paradigm of the 1980s.

Structured programming proved to be a powerful tool that enabled programmers to write moderately complex programs fairly easily. However, as the programs grew larger, even the structured approach failed to show the desired results in terms of bug-free, easy-to-maintain, and reusable programs.

Object-Oriented Programming (OOP) is an approach to program organization and development, which attempts to eliminate some of the pitfalls of conventional programming methods by incorporating the best of structured programming features with several new concepts.

It is a new way of organizing and developing programs and has nothing to do with any particular language. However, not all languages are suitable to implement OOP concepts easily.

Languages that support OOP features include Smalltalk, Objective C, C++, Ada, and Object Pascal. C++, an extension of the C language, is the most popular OOP language today.

C++ is basically a procedural language with object-oriented extension. Java, a pure object-oriented language, is one of the recent languages added to this list, the latest being C#.

Object-Oriented Paradigm

The major objective of the object-oriented approach is to eliminate some of the flaws encountered in the procedural approach. OOP treats data as a critical element in the program development and does not allow it to flow freely around the system.

It ties data more closely to the functions that operate on it and protects it from unintentional modification by other functions. OOP allows us to decompose a problem into a number of entities called Objects and then build data and functions (known as methods in Java) around these entities. The combination of data and methods make up an object.

image_credit — W3schools

The data of an object can be accessed only by the methods associated with that object. However, methods of one object can access the methods of other objects. Some of the features of the object-oriented paradigm are:

  1. Emphasis is on data rather than procedure.
  2. Programs are divided into what are known as Objects.
  3. Data structures are designed such that they characterize the objects.
  4. Methods that operate on the data of an object are tied together in the data structure.
  5. Data is hidden and cannot be accessed by external functions.
  6. Objects may communicate with each other through methods.
  7. New data and methods can be easily added whenever necessary.
  8. Follows the bottom-up approach in program design.

Object-oriented programming is an approach that provides a way of modularizing programs by creating a partitioned memory area for both data and functions that can be used as templates for creating copies of such modules on demand.

Basic Concepts of Object-Oriented Programming

The general concepts of OOP which form the heart of the Java language.

  • Objects and Classes
  • Data Abstraction and Encapsulation
  • Inheritance
  • Polymorphism
  • Compile Time and Runtime Mechanisms
  • Dynamic Binding
  • Message Communication

I will explain these concepts individually in the upcoming articles. So keep following!!

Benefits of OOP

OOP offers several benefits to both the program designer and the user. The new technology promises greater programmer productivity, the better quality of software, and lesser maintenance cost. The principal advantages are:

  1. Through inheritance, we can eliminate redundant code and extend the use of existing classes.
  2. We can build programs from the standard working modules that communicate with one another, rather than having to start writing the code from scratch. This leads to saving of development time and higher productivity.
  3. The principle of data hiding helps the programmer to build secure programs that cannot be invaded by code in other parts of the program.
  4. It is possible to have multiple objects to coexist without any interference.
  5. It is possible to map objects in the problem domain to those objects in the program.
  6. It is easy to partition the work in a project based on objects.
  7. The data-centered design approach enables us to capture more details of a model in an implementable form.
  8. Object-oriented systems can be easily upgraded from small to large systems.
  9. Message passing techniques for communication between objects make the interface descriptions with external systems much simpler.
  10. Software complexity can be easily managed.

While it is possible to incorporate all these features in an object-oriented system, their importance depends on the type of the project and the preference of the programmer.

There are a number of issues that need to be tackled to reap some of the benefits stated above. For instance, class libraries must be available for reuse. The technology is still developing and current products may be superseded quickly. Strict controls and protocols need to be developed if reuse is not to be compromised.

A software that is easy to use is hard to build. It is hoped that object-oriented programming languages like C++ and Java would help manage this problem.

Applications of OOP

Real-business systems are often much more complex and contain many more objects with complicated attributes and methods. OOP is useful in this type of application because it can simplify a complex problem. The promising areas for applications of OOP include:

  1. Real-time systems
  2. Simulation and modeling
  3. Object-oriented databases
  4. Hypertext, hypermedia, and expert text
  5. AI and expert systems
  6. Neural networks and parallel programming
  7. Decision support and office automation systems
  8. CIM/CAD/CAD system

It is believed that the richness of the OOP environment will enable the software industry to improve not only the quality of software systems but also its productivity. Object-oriented technology is certainly changing the way software engineers think, analyze, design, and implement systems today.

References:

[1] https://www.educative.io/blog/object-oriented-programming

[2] https://searchapparchitecture.techtarget.com/definition/object-oriented-programming-OOP

[3] https://examradar.com/procedure-oriented-programming-vs-oop/

--

--

Unnati Shah

Data enthusiast, currently pursuing MS in Computer Science @ USC. For more information visit my website: https://unnatibshah.github.io/