Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in,out,inout,return parameter direction in UML

As i read the following concepts through UML specification promoted by OMG 2.5 (Beta) as:

in: Indicates that Parameter values are passed in by the caller.

inout:Indicates that Parameter values are passed in by the caller and then back out to the caller.

out:Indicates that Parameter values are passed out to the caller.

return:Indicates that Parameter values are passed as return values back to the caller.

Does this mean that the "in" is as call by value and "inout" as call by reference?

could you please clarify each one of those concepts a bit?

like image 223
Andrew Avatar asked Feb 10 '13 15:02

Andrew


People also ask

What is Operation signature in UML?

It is a destructor in the context of C++ code generation. The visibility part of the signature syntax only applies when editing a signature. It is not shown otherwise. A decorator on the operation icon shows the visibility of the operation.

How do you represent inheritance in UML?

In UML, an inheritance relationship is represented by an arrow with a triangular tip pointing from the derived class to the base class. Inherited attributes and methods are not repeated in the representation of the derived class.

What is operations in UML diagram?

A UML operation is a declaration, with a name, parameters, return type, exceptions list, and possibly a set of constraints of pre- and post-conditions. But, it isn't an implementation—rather, methods are implementations.

How do you show inheritance in a class diagram?

Inheritance is shown in a class diagram by using a solid line with a closed, hollow arrow. Bidirectional association: The default relationship between two classes. Both classes are aware of each other and their relationship with the other. This association is represented by a straight line between two classes.


2 Answers

• in - An input Parameter (may not be modified).

• out - An output Parameter (may be modified to communicate information to the caller).

• inout - An input Parameter that may be modified.

• return -A return value of a call.

like image 162
Carlos Avatar answered Sep 20 '22 14:09

Carlos


Call by reference is one possible implementation of inout and out, yes.

Remember that UML is describing a behavior in a language-neutral way. It is up to the implementation of a given interface in an actual language to determine what this means.

In a language like Ada, with language-level in , out, and in out parameters, this can be expressed directly in the language, and the compiler can decide where reference or copy is a better implementation. In a language like Python, where all parameters are passed by reference (sort of), this notation of intent at the UML level does not result in any distinction at the implementation level. And in a language like C, with explicit pointer types and all parameters passed by value, these intents expressed in UML turn into explicit address references and pointer dereferences.

In other words, the short answer is "yes, that's roughly what it means, but it may not be what it does".

like image 35
jimwise Avatar answered Sep 20 '22 14:09

jimwise