本文介绍了如何显示静态方法的用法UML类图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在UML类图中显示静态方法的使用?
How do i show the use of static methods in a UML class diagram?
class A{
public static void test(){
}
}
class B{
public void b(){
A.test();
}
}
显示关系的类图将如何显示?如果有所不同,可以准备UML 2.0.
How would a class diagram look like, which shows the relationship? UML 2.0 would be prepared, if there is a difference.
推荐答案
要显示静态方法,请在静态方法的名称下划线-查看以获取更多详细信息.
To show a static method you underline the name of the static method - have a look here for more detailed info.
关于建立这种关系; class B
取决于class A
的存在.我们可以说B类对A类具有使用依赖"
As for navigating that relationship; class B
is dependent on the existance of class A
. We can say that class B has a "usage dependency" on class A
class B ----uses----> class A
希望这会有所帮助.
这篇关于如何显示静态方法的用法UML类图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!