How to show usage of static methods UML Class Diagram

前端 未结 3 684
闹比i
闹比i 2020-12-10 02:22

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();         


        
3条回答
  •  无人及你
    2020-12-10 02:44

    @RobertMS is right.

    Another alternative, is to use stereotypes:

    ..............................................................
    ....+----------------------------------------------------+....
    ....|                StringUtilityClass                  |....
    ....+----------------------------------------------------+....
    ....| [+] void: lowerCase()              <> |....
    ....| [+] void: upperCase()              <> |....
    ....| [+] String: toString()                <> |....
    ....+----------------------------------------------------+....
    ....| [+] String: LowerCaseCopy(String Value) <> |....
    ....| [+] String: UpperCaseCopy(String Value) <> |....
    ....| [+] String: ReverseCopy(String Value)   <> |....
    ....+----------------------------------------------------+....
    ..............................................................
    

    Note Some programming languages best practices, especially those with C case-sensitive syntax, capitalize static functions, and leave in camel-lowercase the rest of functions.

    Cheers.

提交回复
热议问题