next Method Prototype Extension Scheme
up The Interpretation of Service Interfaces
previous The Interpretation of Service Interfaces
  Contents
PDF version   PostScript version

Parameter Passing Modes

A first practical element of the issue just discussed is the interpretation of function parameters. Whereas most high-level languages provide at least one mechanism to pass arguments by reference, very few of them address this issue in an expicit and prescriptive fashion.
In C, passing a structure S by reference is achieved by handing in a pointer to S. Now, the same syntax could be adopted for different reasons. One could be to avoid the overhead of passing a large structure by value, with no intent to alter it. Another could be the necessity to return multiple parameters. Yet another reason would be motivated by the need to actually alter the source structure. These semantically different usage of the language's syntax are not reflected by any syntactic formalism in the language.
C++ goes one step in this direction with the ``pointer to const'' and ``const reference'' constructs. In Java, non-primitive types (i.e. objects) are implicitly passed by reference. The interpreter itself can resolve these issues because it is able to detect if an element of data may be changed or not in the course of the programme's execution. This is however not the case of third-party programmes, which need an explicit indication of the intent of the programmer. In Ada--where nothing is implicit, programmers must signal their intent by using the in, out or in out argument passing mode keywords. The same applies to CORBA IDL. In the latter case as well as in the case of WSDL and SOAP the need is dictated by the one-to-many relationship between the interface and implementation function prototype models.


next Method Prototype Extension Scheme
up The Interpretation of Service Interfaces
previous The Interpretation of Service Interfaces
  Contents

Copyright © 2001 Jean-Marc Rosengard