
Concept of Abstraction.pptx
- Количество слайдов: 5
Concept of Abstraction • An abstraction is a representation of an entity that includes only the most significant attributes • Abstraction allows you to collect instances of entities into groups in which their common attributes need not be considered OOP, Rovaniemi University of Applied Sciences
An Example of Abstraction • Suppose we define birds to be creatures with following attributes: two wings, two legs, a tail and the ability to fly • Then if we say a nightingale is a bird, the description of a nightingale need not include those attributes – Only the attributes that distinguish that species from other species need to be considered – This results in significant simplification of the descriptions of members of the species OOP, Rovaniemi University of Applied Sciences
Simple Abstraction Exercise • Consider the following entities: German shepherd, Collie, Karelian Bear Dog • What are the common attributes of these entities? • What is the higher level of abstraction of these entities? OOP, Rovaniemi University of Applied Sciences
Concept of Abstraction • The two fundamental kinds of abstraction in contemporary programming languages are process abstraction and data abstraction • The concept of process abstraction is among the oldest in programming language design • All subprograms are process abstractions because they provide a way for a for program to specify that some process is to be done, without providing the details of how it is to be done • For instance when a program needs to sort an array of integers, it might call a subprogram sort. Int(list) – This call is an abstraction of the actual sorting process, whose algorithm is not specified OOP, Rovaniemi University of Applied Sciences
Data Abstraction • An Abstract Data Type (ADT) includes only the data representation of one specific data type and the subprograms that provide the operations for the type • A weapon against complexity making large and complicated programs more manageable OOP, Rovaniemi University of Applied Sciences
Concept of Abstraction.pptx