How should I denote static classes in UML?

后端 未结 4 1382
无人及你
无人及你 2020-12-10 04:28

So I did some research about how to denote static methods and classes in UML. I found on these two pages that static methods should be denoted by underlining them, but what

4条回答
  •  被撕碎了的回忆
    2020-12-10 04:47

    IMO static classes (like in C#) should not even be used in OO Design. A static class cannot be instantiated and thus is actually not a class regarding UML semantics.

    You could mark the class as "leaf" (no subclasses) and add a constraint which does not allow non-static members. This would resemble the meaning of the C# static keyword.

提交回复
热议问题