[comp.lang.ada] S/W Engineering question

hagerp@iuvax.cs.indiana.edu (12/28/89)

I am interested in getting some feedback on the ramifications of the
following design decision and one example of the implementation.

An operating system is designed and written in C.  It is desired that
all application programs that run on this system, however, be written
in Ada.  Therefore, all necessary system calls are encapsulated in
a set of Ada interface packages.

The system provides a facility to allocate a buffer for a user application
called "Get".  "Get" is similar to "malloc" in that it returns a pointer
(this is C, remember) to the buffer.  The Ada interface defines a 
routine "GET_BUF" (that actually calls "Get") as follows:

	generic
	    type BUFFER_TYPE is private;
	    type POINTER_TYPE is access BUFFER_TYPE;
	package ALLOCATE_BUFFER is
	    procedure GET_BUF (PTR_BUFFER : in out POINTER_TYPE);

	    procedure FREE_BUF (PTR_BUFFER : in POINTER_TYPE);
	end ALLOCATE_BUFFER;

After an application instantiates the ALLOCATE_BUFFER package, a
call to "GET_BUF" returns an access type for BUFFER_TYPE.

I'm very interested in any comments.

--paul hager		hagerp@iuvax.cs.indiana.edu