11-Abstract%20Data%20Types - 11. Abstract Data Types 11.1...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
ICS 313 - Fundamentals of Programming Languages 1 11. Abstract Data Types 11.1 The Concept of Abstraction ± The concept of abstraction is fundamental in programming ± Nearly all programming languages support process abstraction with subprograms ± Nearly all programming languages designed since 1980 have supported data abstraction with some kind of module
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ICS 313 - Fundamentals of Programming Languages 2 11.2 Encapsulation ± Original motivation: ` Large programs have two special needs: ¾ Some means of organization, other than simply division into subprograms ¾ Some means of partial compilation (compilation units that are smaller than the whole program) ± Obvious solution: a grouping of subprograms that are logically related into a unit that can be separately compiled (compilation units) ` These are called encapsulations ± Examples of Encapsulation Mechanisms ` Nested subprograms in some ALGOL-like languages (e.g., Pascal) ` FORTRAN 77 and C - Files containing one or more subprograms can be independently compiled ` FORTRAN 90 and Ada - separately compilable modules 11.3 Introduction to Data Abstraction ± An abstract data type is a user-defined data type that satisfies the following two conditions: ` 1. The representation of and operations on objects of the type are defined in a single syntactic unit; also, other units can create objects of the type ` 2. The representation of objects of the type is hidden from the program units that use these objects, so the only operations possible are those provided in the type's definition.
Background image of page 2
ICS 313 - Fundamentals of Programming Languages 3 11.3 Introduction to Data Abstraction (continued) ± Advantage of Restriction 1: ` Same as those for encapsulation: program organization, modifiability (everything associated with a data structure is together), and separate compilation
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

11-Abstract%20Data%20Types - 11. Abstract Data Types 11.1...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online