Abstraction (computer science)
In computer science, abstraction is a technique for managing complexity of computer systems.
Description
Abstraction works by establishing a level of complexity on which a person interacts with the system, suppressing the more complex details below the current level.
The programmer works with an idealized interface (usually well defined) and can add additional levels of functionality that would otherwise be too complex to handle.
For example, a programmer writing code that involves numerical operations may not be interested in the way numbers are represented in the underlying hardware (e.g. whether they're 16 bit or 32 bit integers), and where those details have been suppressed it can be said that they were abstracted away, leaving simply numbers with which the programmer can work.
Another example: the a task of sending an email message across continents would be extremely complex if you start with a piece of optic cable and basic hardware components.
- By using layers of complexity that have been created to abstract away the physical cables, network layout and presenting the programmer with a virtual data channel, this task is manageable.
Abstraction can apply to control or to data:
- Control abstraction is the abstraction of actions
- Control abstraction involves the use of subprograms and related concepts control flows
- Data abstraction is that of data structures.
- Data abstraction allows handling data bits in meaningful ways (example: it is the basic motivation behind data type).
One can view the notion of an object as a way to combine abstractions of data and code.
The same abstract definition can be used as a common interface for a family of objects with different implementations and behaviors but which share the same meaning. The inheritance mechanism in object-oriented programming can be used to define an abstract class as the common interface.
The recommendation that programmers use abstractions whenever suitable in order to avoid duplication (usually of code) is known as the abstraction principle. The requirement that a programming language provide suitable abstractions is also called the abstraction principle.
See also
- Abstraction
- Abstraction principle (computer programming)
- Abstraction inversion for an anti-pattern of one danger in abstraction
- Abstract data type for an abstract description of a set of data
- Algorithm for an abstract description of a computational procedure
- Bracket abstraction for making a term into a function of a variable
- Complexity
- Computer program
- Computer programmer
- Computer programming
- Data modeling for structuring data independent of the processes that use it
- Data hiding (encapsulation) for abstractions that hide implementation details
- Greenspun's Tenth Rule for an aphorism about an (the?) optimum point in the space of abstractions
- Higher-order function for abstraction where functions produce or consume other functions
- Lambda calculus for making a term into a function of some variable
- List of abstractions (computer science)
- Refinement (computing) for the opposite of abstraction in computing
External links
- Abstraction (computer science) @ Wikipedia