Previous topic |
Next topic |
Ada Home Page |
Index
Package body
The package body provides the implementation of the resources provided
by the package.
Where the specification shows what the package provides, the body
defines how things are done.
All a user of the package needs to know is what the package provides. The
package is a "black box" to the user of the package. The package
body is not visible to a package user.
General form of package body:
package body package_name is
declarations
end package_name ;
Notes:
- definitions (code) for subprograms declared in the
specification
- supporting declarations may also be present (eg visible routines
represent tasks, and extra routines are declared in the package body
as subtasks in implementing the visible tasks).
- declarations are local - not visible to package user
Example
An example shows the
implementation of a package of routines for working with rectangles, circles,
etc.
Previous topic |
Next topic |
Ada Home Page |
Index
c-lokan@adfa.oz.au / 20 Feb 96