Zubty
Zubty

Reputation: 379

How to show annotations for methods and vars in UML

Lets assume i have the following method:

[superannotation]
fun ultimateMethod([anotherannotation] bla: String) {
  //the ultimate code
}

i would than create something similar to that:
enter image description here

Upvotes: 0

Views: 560

Answers (1)

www.admiraalit.nl
www.admiraalit.nl

Reputation: 6089

UML does not define how to translate an annotation to a UML concept, but yes, a stereotype seems the most logical equivalent, although an annotation can have parameters and a stereotype cannot.

The UML 2.5.1 specification section 12.3.3.4 describes how to define your own stereotype in UML and section 12.3.3.6 describes how to extend a metaclass to use the stereotype. In your case:

stereotypedefinition

Upvotes: 2

Related Questions