Login | Register
My pages Projects Community openCollabNet

18.9.  Parameter

A parameter is a variable that can be passed. In the UML metamodel it is a sub-class of ModelElement.

A parameter is represented within the operation declaration in the operation compartment of a class as follows.

name : type

name is the name of the parameter.

type is the type (UML datatype, class or interface) of the parameter.

The exception is any parameter representing a return value, whose type only is shown at the end of the operation declaration.

18.9.1.  Parameter Details Tabs

The details tabs that are active for parameters are as follows.

ToDoItem

Standard tab.

Properties

See Section 18.9.2, “ Parameter Property Toolbar and Section 18.9.3, “ Property Fields For Parameter below.

Documentation

Standard tab. See Section 13.4, “ Documentation Tab.

Source

Standard tab. This contains a declaration for the parameter.

Tagged Values

Standard tab. In the UML metamodel, Parameter has the following standard tagged values defined.

  • derived (from the superclass, ModelElement). Values true, meaning the parameter is redundant -it can be formally derived from other elements, or false meaning it cannot.

    [Caution]Caution

    A derived parameter is a meaningless concept.

[Note]Note

The UML Element metaclass from which all other model elements are derived includes the tagged element documentation which is handled by the documentation tab under ArgoUML

18.9.2.  Parameter Property Toolbar

Go up

Navigate up through the package structure.

New parameter

This creates a new parameter for the for the same operation as the current parameter, navigating immediately to the properties tab for that parameter.

[Tip]Tip

This is a convenient way to add a series of parameters for the same operation.

New Datatype

This creates a new Datatype (see Section 16.3, “ Datatype) in the namespace of the owner of the operation of the parameter, navigating immediately to the properties tab for that datatype.

New Stereotype

This creates a new Stereotype (see Section 16.6, “ Stereotype) for the selected parameter, navigating immediately to the properties tab for that stereotype.

Delete

This deletes the parameter from the model

[Warning]Warning

This is a deletion from the model not just the diagram. If desired the whole operation compartment can be hidden on the diagram using the presentation tab or the button 2 pop up menu for the class on the diagram.

18.9.3.  Property Fields For Parameter

Name

Text box. The name of the parameter. By convention, the name of a parameter has a leading lower case letter, with words separated by “bumpy caps”.

[Note]Note

The ArgoUML critics do not complain about parameter names that do not have an initial lower case letter.

Stereotype

Drop down selector. There are no UML standard stereotypes for Parameter.

Navigate Stereotype

icon. If a stereotype has been selected, this will navigate to the stereotype property panel (see Section 16.6, “ Stereotype).

Owner

Text box. Records the operation which contains this parameter.

Button 1 double click on the entry will navigate to the operation.

Type

Drop down selector. The type of this parameter. This can be any UML Classifier, although in practice only Class, DataType, or Interface make any sense.

[Note]Note

A type must be declared (it can be void, but this only makes sense for a return parameter). By default ArgoUML supplies int as the type the first time a parameter is created, and thereafter the type of the most recently created parameter.

Default Value

Text box with drop down. This allows you to set an initial value for the parameter if desired (this is optional). The drop down menu provides access to the common values 0, 1, 2, and null.

[Caution]Caution

This only makes sense for out or return parameters.

Kind

Radio box, with entries out, in/out, return, and in.

  • out. The parameter is used only to pass values back from the operation.

  • in/out. The parameter is used both to pass values in and to pass results back out of the operation.

    [Note]Note

    This is the default for any new parameter.

  • return. The parameter is a return result from the call.

    [Note]Note

    There is nothing to stop you declaring more than one return parameter (some programming languages support this concept).

    [Tip]Tip

    The name of the return parameter does not appear on the diagram, but it is convenient to give it an appropriate name (such as the default return to identify it in the list of parameters on the operation property tab.

  • in. The parameter is used only to pass values in to the operation.