Summary
In this final introductory chapter we consider the important topic of putting together a complete program. Such a program will inevitably use predefined material such as that for input and output and we therefore also briefly survey the structure and contents of the extensive predefined library.
The hierarchical library
A complete program is put together out of various separately compiled units. In developing a very large program it is inevitable that it will be conceived as a number of subsystems themselves each composed out of a number of separately compiled units.
We see at once the risk of name clashes between the various parts of the total system. It would be very easy for the designers of different parts to reuse popular package names such as Error_Messages or Debug_Info and so on.
In order to overcome this and other related problems, Ada has a hierarchical naming scheme at the library level. Thus a package Parent may have a child package with the name Parent.Child.
We immediately see that if our total system breaks down into a number of major parts such as acquisition, analysis and report then name clashes will be avoided if it is mapped into three corresponding library packages plus appropriate child units. There is then no risk of a clash between the names Analysis.Debug_Info and Report.Debug_Info since they are now quite distinct.
The naming is hierarchical and can continue to any depth.
- Type
- Chapter
- Information
- Programming in Ada 2012 , pp. 47 - 58Publisher: Cambridge University PressPrint publication year: 2014