x
GMAT
Select Test Select Question Types

GMAT: Statistical Analysis With Categorical Data
Data Abstraction Definition Example

In this lesson, we define the term data abstraction and provide two real-world examples and an example from programming. We demonstrate data abstraction with real-life products and describe how it is used in computer programming.

Data Abstraction Definition Example

What Is Data Abstraction?

Data abstraction is the programming process of creating a data type, usually a class, that hides the details of the data representation in order to make the data type easier to work with. Data abstraction involves creating a representation for data that separates the interface from the implementation so a programmer or user only has to understand the interface, the commands to use, and not how the internal structure of the data is represented and/or implemented.

Smartphone Example

An example in the real-world is a mobile or smartphone. The typical smartphone user does not know how calls are made, or how the phone accesses the Internet, or even how data is stored in the phone. Instead, the mobile or smartphone user is provided with an interface that hides these details from them. Making a call simply involves selecting a contact's phone number. Accessing the Internet involves selecting an icon on the screen.

The user does not need to understand the details of how a phone call is placed or how the Internet works. These details are abstracted away from the phone's interface in order to make the phone easier and more effective to use. The design of the mobile or smartphone clearly separates the interface from the implementation. The user can learn the functions of the phone without ever having to know anything about how the phone works internally.

Automobile Example

Another real-life example is an automobile. Most people today know how to operate an automobile without knowing anything about how the internal combustion engine works or how the transmission works. There was a time when most automobile users did have to know something about these details, but as automobile technology improved, the details of the engine and other working parts were abstracted away so that the driver primarily only has to know how to start a car, how to make the car go and stop, how to steer the car, and how to add gasoline when the gas tank is empty.

The automatic transmission is another example of abstraction. When cars were first produced, they only had manual transmissions, and all car drivers had to learn how to shift the gears of the transmission in order for the car to move forward or backward. Over time, the introduction of the automatic transmission abstracted away this layer of knowledge about the implementation of the automobile, making car driving easier for the user.

Computer Programming Example

In computer programming, the primitive data types of programming languages are themselves abstractions. For example, the string data type hides many details from the programmer. First, the programmer doesn't need to know how single characters are stored in the computer or even how combinations of characters are put together to form a string. The same holds true for numeric data types. The programmer doesn't need to know how numbers are stored internally in the CPU or how the arithmetic operators work to perform arithmetic on numbers. These details are hidden from the programmer via abstraction in order to make programming easier and more effective.

We can see the progression of programing languages themselves as an abstraction process. The first tools for programming were patch panels, where the programmer literally changed the circuitry of the computer in order to write a program. The next progression was to machine language, where programmers wrote instructions in terms of binary codes.

From there, programming advanced to assembly language, where the details of machine language were abstracted into more English-like commands, making programming much easier. The next level of abstraction was to languages such as Fortran, which managed to abstract away some details of assembly language to make programming even easier.

Now we have object-oriented languages, which rely totally on abstraction to hide the details of objects the programmer uses, and we have declarative languages, such as SQL, where the level of instruction is abstracted so that the SQL programmer tells the computer what to do and SQL figures out how to do it.

Share This Page