Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UML class diagram - represent attribute with initial value

Tags:

class

uml

diagram

How is an attribute with initial value (such as a static constant) represented in UML?

public class Foo {
    public static final int BAR = 17;
}
like image 914
ThisClark Avatar asked Mar 31 '16 03:03

ThisClark


People also ask

How do you represent attributes in class diagram?

In domain modeling class diagrams, an attribute represents a data definition for an instance of a classifier. An attribute describes a range of values for that data definition. A classifier can have any number of attributes or none at all. Attributes describe the structure and value of an instance of a class.

Can UML represent class attributes?

UML provides mechanisms to represent class members, such as attributes and methods, and additional information about them like constructors.

What is attributes in UML class diagram?

In UML models, attributes represent the information, data, or properties that belong to instances of a classifier. A classifier can have any number of attributes or none at all. Attributes describe a value or a range of values that instances of the classifier can hold.


1 Answers

The initial value of an attribute in a UML class diagram is represented just like variable assignment in a language like Java.

enter image description here

Moreover, since the example attribute is static, it should be underlined. Capitalization is by language or other convention and is not a UML specification.

like image 134
ThisClark Avatar answered Nov 01 '22 04:11

ThisClark