UML class diagram - represent attribute with initial value
14,573
The initial value of an attribute in a UML class diagram is represented just like variable assignment in a language like Java.
Moreover, since the example attribute is static, it should be underlined. Capitalization is by language or other convention and is not a UML specification.
Comments
-
ThisClark almost 2 years
How is an attribute with initial value (such as a static constant) represented in UML?
public class Foo { public static final int BAR = 17; }
-
Geert Bellekens about 8 yearsUML does not say anything about capitalizing names of constants.
-
Oliver over 3 yearsOut of curiosity, what software are you using?
-
ThisClark over 3 yearsThat screenshot I'm pretty certain came from Microsoft Visio 2010. Nowadays I would go for the free and less capable Lucidcharts. I never need UML outside of teaching
-
Alan over 3 years@ThisClark plantuml is an interesting alternative for simple diagrams. (It is text based, with automated layout.)