Previous topic |
Next topic |
Ada Home Page |
Index
Program Architecture
Designing the program architecture means deciding what the modules of the
program will be.
- Which procedures will be written?
- How will they communicate?
- How will they be assembled to produce the final program?
Designing procedures
Procedures might be recognised as worthwhile modules in either a
top-down or bottom-up programming approach.
- procedures represent sub-tasks
- hierarchy of actions
- partition by function
- high levels manage, low levels do the work
- procedures for low-level operations first
- high-level (managing) code later
Examples
- TEXT_IO : procedures for character & string I/O
- Screen I/O: draw window, move to location, ...
clear_screen;
move_to ( row => 10, col => 20);
- Input repeatedly, until value within a given range
get_integer (num, 1, 10);
get_integer (val, 0, 100);
Benefits: incremental development, re-use
Alternative architectures
The same basic structure can be implemented in several different ways.
For example, even a trivial program which just reads in and then
adds two integers
might be structured in the following ways (among others).
Previous topic |
Next topic |
Ada Home Page |
Index
c-lokan@adfa.oz.au / 15 Feb 96