问题
I want to make an public method:
fun createStringBinding(@PropertyKey(resourceBundle = BUNDLE_NAME) key: String, vararg args: Any): StringBinding {
return Bindings.createStringBinding(Callable { get(key, *args) }, Settings.language)
}
how would this look like in an UML i was doing it like that but i am not sure if this is correct and i also don't know where to look for that...
Is this correct?
回答1:
The notation for operations is described in the UML specifications published by OMG, version 2.5.1, section 9.6.4 and for parameters in section 9.4.4. The latter reads as follows:
<parameter> ::= [<direction>] <parameter-name> ’:’ <type-expression> [’[’<multiplicity-range>’]’] [’=’ <default>] [’{’ <parm-property> [’,’ <parm-property>]* ’}’]
The multiplicity must be put behind the parameter type, not behind the name. Your operation would be specified as follows:
+ createStringBinding(key : String, args : Any[0..*]): StringBinding
Note, that Any
and StringBinding
are not standard UML data types.
UML does not have a standard notation for annotations.
来源:https://stackoverflow.com/questions/56488387/undefined-amount-of-arguments-in-uml