The C# static classes are classes that cannot be instantiated. Moreover
they are supposed to contain only static members and are sealed.
There is no static class in UML. But therer are all the tools necessesary:
- A class that cannot be instantiated is generally called an abstract class in UML. This terminology is slightly different from some popular languages which bind this notion with the presence of abstract “methods” / “functions” / operations. Some may claim that a static class is not incomplete, however it misses a core feature that is necessary for normal classes: the means (constructors, implicit or explicit) that are needed to make it a normal class.
- a class that is “sealed” is called a leaf class in UML.
isLeaf
is a property of classes in UML but there is no notation defined. U
Pragmatically {leaf}
is used next to the class name (this notation was defined in some previous UML versions but no longer in the current one).
- all members are static means that they should all be shown in underlined.
If you want to quickly show that you do not mean an abstract leaf class with all members being static by coincidence, you could create a special profile that could specify your own stereotype to clarify, e.g «static class»
, or use an existing C# profile (check if one is delivered with your favorite modeling tool before reinventing the wheel).