Difference between revisions of "XCSG:Parameter"

From AtlasWiki
Jump to: navigation, search
(Created page with "The semantics of Parameter include those common to UML [5, p. 2-51, 2-69], MS-IL, and the JVM. The defaultValue of a Parameter must be compatible with its type. When default...")
 
Line 7: Line 7:
  
 
== Specifications ==
 
== Specifications ==
 +
 +
{| class="atlaswikitable" style="width:100%"
 +
! width="160" align="left" | Metaclass
 +
| Parameter
 +
|-
 +
! Extends
 +
| [[Variable]], [[TemplateParameter]]
 +
|-
 +
! Description
 +
| An unbound variable used in the specification of an operation, a message, an event, a template, etc.
 +
|-
 +
! References
 +
| [5, p. 2-14, Figure 2-5], [5, p. 2-51, 2-69], [26, CodeParameterDeclarationExpression]
 +
|}
 +
 +
{| class="atlaswikitable"  style="width:100%"
 +
! width="160"| Attribute
 +
| kind
 +
|-
 +
! Type
 +
| [[ParameterDirectionKind]]
 +
|-
 +
! Description
 +
| The kind of parameter (in, out, inout, return)
 +
|}
  
  

Revision as of 13:55, 5 March 2014

The semantics of Parameter include those common to UML [5, p. 2-51, 2-69], MS-IL, and the JVM.

The defaultValue of a Parameter must be compatible with its type.

When default parameter values are overridden, the default parameter value associated with a call should always be determined by the run time type of the target object.


Specifications

Metaclass Parameter
Extends Variable, TemplateParameter
Description An unbound variable used in the specification of an operation, a message, an event, a template, etc.
References [5, p. 2-14, Figure 2-5], [5, p. 2-51, 2-69], [26, CodeParameterDeclarationExpression]
Attribute kind
Type ParameterDirectionKind
Description The kind of parameter (in, out, inout, return)


Language Mappings

The kind property is related to the use of keywords such as const (in C++), final (in Java), or in, out and inout (in Ada), which restrict read/write access to individual parameters. C++ does not handle overridden default parameter values correctly, as explained by Scott Meyers [47, Item 38].