Skip to content
Search

Object oriented programming

lastmod 2026-04-08created 2015-02-2712 edits

Rather than simply dividing a program into data and processing methods, it divides a program into many basic units called 'objects' and describes the program as the interaction of these objects.

Object-oriented programming (OOP) is one of the paradigms of computer programming. Object-oriented programming moves away from the view of a computer program as a list of instructions and instead tries to see it as a collection of several independent units, that is, "objects". Each object can send and receive messages and process data.

Object-oriented programming is widely used in large-scale software development because it makes programs flexible and easy to change. It also has the advantages of making programming easier to learn, simplifying software development and maintenance, and enabling more intuitive code analysis. However, it is sometimes criticized because an excessive tendency to turn programs into objects fails to reflect the real world as it is.

The three most important properties are encapsulation, inheritance, and polymorphism.

You should also be familiar with the five principles of object-oriented design (SOLID).

Features of OOP

The basic features of object-oriented programming are data abstraction, inheritance, polymorphism, and dynamic binding, with additional features such as multiple inheritance. In object-oriented programming, based on data abstraction, inheritance, polymorphism, and dynamic binding work together to control the complexity of a system.

Depending on the scholar, a few more are added to these features, and the scope of each feature sometimes differs slightly. Since even the exact definition and scope of object orientation have not been fully agreed upon, views on the definition of each feature can also differ slightly.

Encapsulation.
Bundling the data and the behavior (functions) to be represented into a single unit; this bundle is called an object1. Because the data representing the characteristics of the target and the functions managing that data are always used as one bundle, an object is self-contained and can be used as a component of a program. For this reason, objects are sometimes called software ICs.
Abstraction.
Data abstraction makes a program simple by hiding unnecessary information and representing only important information. A data type defined through data abstraction is called an abstract data type. An abstract data type encapsulates the data representation and the operations of a data type, and can hide the information of the data type through access control. In object-oriented programming, an abstract data type is generally called a class, an instance of an abstract data type an object, an operation defined in an abstract data type a method, and a method call a message.
Inheritance.
Inheritance is a feature that lets a new class use the data and operations of an existing class. The new class that inherits is called a subclass, derived class, lower class, or child class, and the existing class that the new class inherits from is called a base class, superclass, or parent class. Through inheritance, a class can be modified to fit the needs of a program by using a subclass that inherits an existing class, and objects can be organized by forming dependency relationships between classes.
Polymorphism.
Polymorphism means putting several concepts into a single element, and generally refers to overriding (methods with the same name performing different functions in different classes) or overloading (methods with the same name performing different functions depending on the number or data types of their arguments). Through polymorphism, the relationships between objects in a program can be expressed systematically.
(Information) Hiding.
An object defines properties to remember its state and behaviors that manage those properties. Of these, only the functions used from outside can be exposed while the rest are hidden; this is called information hiding. It is a means of securing the object's own safety by preventing outsiders from changing the object's state at will or requesting unauthorized behavior, and information hiding makes an object more robustly encapsulated.

Brief analogy

Feature

Short description

C++ analogy

Encapsulation

Bundles

class

Abstraction 2

Represents

class

Inheritance

Reuses

class ClassA : public ClassB

Polymorphism

Varies with the situation

overloading, overriding

Hiding

Hides

private

(This is only a brief analogy for quick understanding, not an exact definition; it summarizes only the core points. Polymorphism in particular is a concept that is hard to explain in one word)

See also

Favorite site

References


  1. More precisely, it is an instantiation. ↩

  2. In computer science, abstraction refers to extracting the core concepts or functions from complex data, modules, systems, and so on. ↩

    1. The object exists in the real world, 2. The object works by contracts, 3. The object is unique, 4. The object is immutable, 5. The object's class has no static members, 6. The object's name is not a job title, 7. The object's class is either Final or Abstract

    ↩

author Zer0 sitemap