Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A brief history of abstraction mechanisms in programming, starting from the concept of stacks and modules, and moving on to abstract data types and object-oriented programming. It discusses the importance of information hiding and the role of modules in implementing abstract data types.
Typology: Lecture notes
1 / 23
If you op en an atlas you will often rst see a map of the world. This map will show only the most signi cant features. For example, it may show the various mountain ranges, the o cean currents, and other extremely large structures. But small features will almost certainly b e omitted. A subsequent map will cover a smaller geographical region, and will typically p ossess more detail. For example, a map of a single continent (such as South America) may now include p olitical b oundaries, and p erhaps the ma jor cities. A map over an even smaller region, such as a country, might include towns as well as cities, and smaller geographical features, such as the names of individual mountains. A map of an individual large city might include the most imp ortant roads leading into and out of the city. Maps of smaller regions might even represent individual buildings. Notice how, at each level, certain information has b een included, and certain information has b een purp osely omitted. There is simply no way to represent all the details when an artifact is viewed at a higher level of abstraction. And even if all the detail could b e describ ed (using tiny writing, for example) there is no way that p eople could assimilate or pro cess such a large amount of information. Hence details are simply left out. Fundamentally, p eople use only a few simple to ols to create, understand, or manage complex systems. One of the most imp ortant techniques is termed abstraction.
Abstraction is the purp oseful suppression, or hiding, of some details of a pro cess or artifact, in order to bring out more clearly other asp ects, details, or structure.
Consider the average p ersons understanding of an automobile. A laymans view of an automobile engine, for example, is a device that takes fuel as input and pro duces a rotation of the drive shaft as output. This rotation is to o fast to
connect to the wheels of the car directly, so a transmission is a mechanism used to reduce a rotation of several thousand revolutions p er minute to a rotation of several revolutions p er minute. This slower rotation can then b e used to prop el the car. This is not exactly correct, but it is suciently close for everyday purp oses. We sometimes say that by means of abstraction we have constructed a model of the actual system.
engine
fuel
In forming an abstraction, or mo del, we purp osely avoid the need to un- derstand many details, concentrating instead of a few key features. We often describ e this pro cess with another term, information hiding.
Information hiding is the purp oseful omission of details in the development of an abstract representation.
In a typical program written in the ob ject-oriented style there are many imp or- tant levels of abstraction. The higher level abstractions are part of what makes an ob ject-oriented program ob ject-oriented. At the highest level a program is viewed as a \community" of ob jects that must interact with each other in order to achieve their common goal: