CPSC 320: Week 9
Packages
Packages allow us to define Abstract Data Types
Data Type - set of values and operations
Abstract - pay attention to relevant details (ie what operations are available)
Abstract - ignore details not relevant to task at hand (ie how operations are implemented)
Word package:
specification
,
Word package:
implementation
,
Example: Big numbers:
Specification
, and a
sample program
that uses it. Bignum
implementation.
Specification and client of an
Integer Stack Package
Integer Stack Package
Program 3
: Now available
A useful summary of Ada (but accuracy not guaranteed)
A similar idea, comparing Ada and Java
Reading on packages: Chapter 11 and section 3.1
Generic Packages
Reading on generic packages: Chapter 17 and section 3.4
Terms:
ADT: Abstract data type: type and operations are available to client, but implementation details are not available to client
Interface of an ADT: Items listed in specification that are available to the client
Another generic package:
Interface for Queue ADT
Reading on generic packages: Chapter 17 and section 3.4
Previous Week
Entire Semester
Next Week
--
ITEC 320 Home Page
, --
Dr. Okie's Home Page
,
Last modified on
Check my grades