next up previous
Next: The Instantiation of Up: Separation of Concerns Previous: Context Binding Time

Genericity of Content

The example of Ada generic stacks is a common one, and is typically presented as a textbook example. What is not typically done is to separate the mechanism of the underlying structure on which the stack is built from the content of the stack operations, again an issue of separation of concerns. This underlying Sequence structure is clearly contentual context since it is used as a result of an implementation design decision. It therefore should not appear in the concept.

Unfortunately, the only current method in Ada of providing contentual context directly in a package body is by using a with clause. This binds context very early in the software life cycle, resulting in context that is in a sense invariant, i.e., context that is fixed for the life of the package body. The generic facility in Ada mixes conceptual and contentual context parameters in one generic specification part. For this paper we suggest an extension to Ada allowing for a one-to-many mapping between the Stack concept and its content.

 
generic

-- contentual context

type Sequence is private;

with {operations on type Sequence}

package body Standard_Stacks implements Stacks as

.

end Standard_Stacks;



Larry Latour
Fri Feb 23 23:01:25 EST 1996