CPSC 320: Week 16
- Stepwise Refinement
- Abstract Data Objects:
When using a package to define an Abstract Data Object
the package implementation contains declarations of variables
that the client accesses and manipulates using the operations in the
specification. The client accesses the object by instantiating and
use
ing the package.
Thus the client can only access more than one such object
(eg more than one stack) by instantiating the package several times.
- Exam Topics
- In case you're curious: more OO in Ada
- A sample project
- Inputs a list of employees that are salaried or wage and calculates their pay and
prints two lists: employees sorted by id, and ascending salaries only
- p3.adb contains the main program
- all_emp.ads/b contains the employee package
- a generic list package is also included
- Tagged record types can be extended with new fields
- Parameters of type Type'Class allows parameters of subclass type
- Polymorphism is only possible when using pointers