Optional parameter with UML class diagram -
is there official syntax specifying optional parameter of method in uml class type diagram?
for example, have method:
public function abc( $arg = 0) { ... return void; }
how indicate $arg optional parameter , default value?
uml 2.5 has following definition parameterlist
<parameter-list> list of parameters of operation in following format: <parameter-list> ::= <parameter> [‘,’<parameter>]* <parameter> ::= [<direction>] <parameter-name> ‘:’ <type-expression> [‘[‘<multiplicity>’]’] [‘=’ <default>] [‘{‘ <parm-property> [‘,’ <parm-property>]* ‘}’]
where:
<direction> ::= ‘in’ | ‘out’ | ‘inout’ (defaults ‘in’ if omitted).
<parameter-name> name of parameter.
<type-expression> expression specifies type of parameter.
<multiplicity> multiplicity of parameter. (see multiplicityelement – sub clause 7.5).
<default> expression defines value specification default value of parameter.
<parm-property> indicates additional property values apply parameter.
so can use
+ abc($arg : integer = 0)
the type expression not optional can't leave out, guess can think of convention use unspecified
Comments
Post a Comment