Object-oriented programming (OOP)

 Object Oriented Programming (OOP) is a computer programming model that organizes software design around data or objects, not functions and logic. An object can be defined as a data field with unique attributes and behavior.

OOP focuses on the objects you want the program to interact with, not the logic required to manipulate them. This approach to programming works well for software that is large, complex, and needs to be actively updated or maintained.

Object-oriented programming (OOP)


The structure of an object-oriented program is also advantageous for developing in cooperation, in which projects are worked on in groups.


Other benefits of OOP are code reusability , scalability, and efficiency. Even when using microservices , developers should continue to apply the principles of OOP.


The first step in OOP is to collect all of the objects that a programmer is trying to manipulate and identify how they relate to one another - an exercise often referred to as data modeling .


Object orientation using the example of an employee

Figure 1: The example of an employee shows how objects are classified and integrated.

Examples of an object can range from physical units, such as a person, described by properties such as name and address, to small computer programs such as widgets.


Once an object is known, it is assigned to a class of objects that defines the type of data it contains and any logical sequences that can manipulate the object. Each different sequence of logic is called a method. Objects can communicate using well-defined interfaces called messages.


Principles of OOP

Object-oriented programming is based on the following principles:


Encapsulation . The implementation and state of each object are kept private within a defined limit or class. Other objects do not have access to this class or the authority to make changes, but can only call a list of public functions or methods. This offers greater program security and avoids unintentional data corruption.

Abstraction . Objects only reveal internal mechanisms relevant to the use of other objects and hide unnecessary implementation code. This concept helps developers make changes and additions over time.

Inheritance . Relationships and subclasses between objects can be assigned so that developers can reuse common logic while maintaining a clear hierarchy. This characteristic of OOP forces more thorough data analysis , reduces development time, and provides greater accuracy.

Objects can take more than one shape depending on their context. The program determines what meaning or use is required for each execution of that object and reduces the need to duplicate code.

Object-oriented programming languages

Simula is considered to be the first object-oriented programming language. However, some of the most popular OOP languages ​​include:


Java

JavaScript

Python

C++

Visual Basic .NET

Ruby

Scala

PHP

OOPSLA is the annual conference for object-oriented programming systems, languages ​​and applications.


OOP Critique

The object-oriented programming model has been criticized by developers for several reasons. The biggest concern is that OOP overemphasizes the data component of software development and does not focus enough on computations or algorithms . In addition, OOP code can be more complicated to write and take longer to compile.



Alternative methods to OOP are:


functional programming

structured programming

imperative programming

Most advanced programming languages ​​allow developers to combine these models.

YOU CAN NOW JOIN OUR OFFICIAL SOCIAL MEDIA GROUP FOR SWIFT UPDATES, GISTS, AND INTERACTIONS.

Post a Comment

1 Comments