UML类图-用初始值表示属性 [英] UML class diagram - represent attribute with initial value
本文介绍了UML类图-用初始值表示属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何用UML表示具有初始值(例如静态常量)的属性?
How is an attribute with initial value (such as a static constant) represented in UML?
public class Foo {
public static final int BAR = 17;
}
推荐答案
在UML类图中的属性的初始值就像在Java这样的语言中的变量赋值一样表示.
The initial value of an attribute in a UML class diagram is represented just like variable assignment in a language like Java.
此外,由于example属性是静态的,因此应加下划线.大写是通过语言或其他约定,而不是UML规范.
Moreover, since the example attribute is static, it should be underlined. Capitalization is by language or other convention and is not a UML specification.
这篇关于UML类图-用初始值表示属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文