Simply using Ada doesn't support the design for reuse. We have to understand and design for it, using the features of Ada. Is it possible to reuse a component without having a reusable component ?. Similar analogy can be made to an automobile industry, it wouldn't be possible to build huge number of cars without having ready made reusable parts. So an emphasis here is that we need to attend our focus on design for reuse rather than design with reuse.
Here we are mainly concerned with Ada features supporting the design for reuse. Before formulating design guidelines, we must know that the general criteria to followed when writing reusable code. There are three such criteria has proposed by [ Gargaro, Pappas'87 ] specifically for Ada programs. A reusable program should be:
* Transportable
* An orthogonal (context-independent) composition, and
* Independent of the runtime system.
They say, how do you write reusable code when your methodology doesn't address reusability? So in the near term reusability may be restricted to what is achievable through proficiency in Ada. In other words, the programmer must have knowledge of both the language features that facilitate part reuse and the features that compromise part reuse.
The main objective here is to design software which is reliable, managable, and reusable. This means that the designer needs to follow some well defined guidelines which could be called as meta rules or feedback rules. The main purposes of this guidelines are firstly, to estimate the reuse potential of a program either by a human or system, and secondly, design or redesign components for reuse following the guidelines.
This chapter analyses how Ada's technical capabilities such as types & subtypes, arrays, strings, attributes, records, access, functions & procedures, packages, tasks, exceptions, and generics, could be used more efficiently in designing components for reuse. The following are some of the guidelines supporting design for reuse with the features of Ada.