Abstraction (computing)
The abstraction consists of isolating an element from its context or from the rest of the elements that accompany it. In programming, the term refers to the emphasis on the "what does it do?" rather than "how do you do it?" (black box feature). The common denominator in the evolution of programming languages, from the classic or imperative to the object-oriented, has been the level of abstraction that each of them makes use of.
Abstraction can also be understood as the method used when analyzing a particular element, disregarding aspects that are not relevant to the specific study, and considering only the essential properties for said analysis, thereby facilitating a better understanding of said element and thus reducing the effort that must be invested in its understanding.
Programming languages are the tools by which language designers can implement abstract models. The abstraction offered by programming languages can be divided into two categories: data abstraction (pertaining to data) and control abstraction (pertaining to control structures).
The different programming paradigms have increased their level of abstraction, starting from machine languages, the closest to the computer and the furthest from human comprehension; going through command languages, imperatives, object orientation (OOP), Aspect Oriented Programming (POA); or other paradigms like declarative programming, etc.
Abstraction from the point of view of object-oriented programming expresses the essential characteristics of an object, which distinguish the object from others. In addition to distinguishing between objects, it provides conceptual boundaries. So it can be said that encapsulation separates essential from non-essential features within an object. If an object has more characteristics than necessary, they will be difficult to use, modify, build and understand, especially when it is an integer method with fractional termination.
It creates an illusion of simplicity since it minimizes the number of characteristics that define an object.
For years, programmers have been building very similar applications that solve the same problems over and over again. To ensure that their efforts could be used by other people, the OOP was created, which consists of a series of standards to guarantee interoperability between users so that the code can be reused.
Examples
Thinking in terms of objects is much like we would in real life. An analogy would be modeling a car in an OOP schematic. We would say that the car is the main element that has a series of characteristics, such as color, model or brand.
To give another example, we are going to see how we would modernize a fraction in an OOP scheme, that is, that mathematical structure that has a numerator and a denominator that divides the numerator, for example 3/2. The fraction will be the object and will have two properties, the numerator and the denominator. Then it could have various methods like simplifying, adding with another fraction or number, subtracting with another fraction, etc.
These objects can be used in programs, for example in a mathematics program you can use fraction objects and in a program that manages a car workshop, auto objects. Object-oriented programs use many objects to perform the actions they want to perform, and they are objects themselves. That is, the car workshop will be an object that will use auto, tool, mechanic, and spare objects.
Contenido relacionado
MediaWiki:Revhistory
MediaWiki:Loginsuccess
Bash