Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show constants in UML CLASS DIAGRAM?

Tags:

I can't decide how to show constant class properties in Uml Diagram. Can you suggest me how to do it?

like image 387
Farid Movsumov Avatar asked Nov 16 '12 08:11

Farid Movsumov


People also ask

How do you represent a constant in UML class diagram?

Class (i.e. static) methods and fields are indicated by underlining. Constant (i.e. final) fields are indicated via naming convention: constants should be in ALL_CAPS.

Do you include constants in UML?

A constant is a minor implementation detail and logically, it is not a member of the class, it bears no meaning in the OO view of things. So the answer is "you don't". Show activity on this post. The notion of a constant in UML exists, but it's usually inside a class and has a type.

How do I show static in UML?

The UML denotes static features by underlining them. The static keyword may modify attributes and operations alike, and is independent of other modifiers such as public or private .

How do you represent implements in class diagram?

In domain modeling class diagrams, an implements relationship represents a class that implements the operations in a Java™ interface. As the following figure illustrates, an implements relationship is displayed as a dashed line with an unfilled arrowhead.


1 Answers

I would do it like this:

CONSTANT_NAME : constant_type = value 

E. g.:

PI : double = 3.1415 
like image 130
dstronczak Avatar answered Sep 17 '22 19:09

dstronczak