1/15
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Unity of a program in modularity
Functions, data structures, modules
interface in modularity
Types and operations defined in a component that are visible outside it
specification
describes the intended functionality of a component as observed through the interface
implementation
data structures and functions inside the component not necessarily visible from outside
data type defining in abstraction
by its values and the operations that can be performed on it
what is hidden in data abstraction
the representation of the data and operations (encapsulation)
what does control abstraction do
hides implementation details of procedure bodies
what does data abstraction do
hides how data structures are represented and how operations are implemented
example of implementation hiding
A priority queue implemented as a binary search tree, a partially ordered vector
purpose of linguistic support in abstraction
to enforce information hiding at the language level
core idea of ADTs
separate the interface from the implementation
Example: A set with operations like empty, union, insert, is_member implemented using vectors or lists
type checking
ensures interface/implementation separation together with encapsulation
ADT for a stack of int
includes operations like push , pop, empty, and internal management of the stack structure
representation-independent
the user cannot distinguish between different correct implementations of the same abstract type
encapsulation
the implementation can be changed without affecting users of the component
use of modules
Information hiding and organizing code. 2 parts of a module: Interface: names and types exposed to the user, Implementation: declarations and internal details. Examples: in ML: Structures, in Ada: packages