Previous topic |
Next topic |
Ada Home Page |
Index
Designing Records
Programs often use information about real-world objects
- usually only a small subset of all possible information
-
For example, the number of things you can record about a person is almost
limitless, but for any particular purpose only a few things are relevant.
- part of design process is to select the appropriate subset
-
For example, a fitness club may need to know the name, phone number,
sex, age, and weight of its customers.
- would use a record to combine components
To design a record:
- identify the items of data that are relevant
in this application
- use a data structure diagram to show the relevant information
- decide on names for the overall structure,
and for the individual fields
- determine the data types of the fields
Fitness club example:
name : names; -- string sub-type
phone : phones; -- string sub-type
sex : sexes; -- enumerated type
age : ages; -- integer sub-range
weight : weights; -- float sub-type
Previous topic |
Next topic |
Ada Home Page |
Index
c-lokan@adfa.oz.au / 27 Feb 96