Академический Документы
Профессиональный Документы
Культура Документы
> Analyzing and Modeling Architecture > Create models for your app >
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Properties of attributes on UML class diagrams.
On a UML class diagram, you can add attributes to classes and interfaces. An attribute defines values that can be
attached to instances of the class or interface.
To add an attribute, right-click the class or interface, point to Add, and then click Attribute.
If the attributes of a class on the diagram are not visible, click the chevron at the top of the class or interface to
expand it. If you can see the Attributes header, click [+] to expand the attributes section.
Signature of an Attribute
An attribute's signature is the line that represents it in a class or interface on a UML class diagram. It has this
form:
+ denotes public Visibility. The other permitted values are - (private), # (protected), ~ (package).
Properties
The following table describes the properties of an attribute in a class or interface on a UML class diagram.
To see the properties of an attribute, right-click the attribute in the class or interface on the diagram, and then
click Properties. The properties appear in the Properties window.
Default (empty) The value of the attribute when the classifier is instantiated.
Value
Is Read Only False If true, the value of the attribute cannot be changed.
Is Static False If true, a single value for this attribute is shared between all instances of this
type.
Type (none) A primitive type such as Integer, or a type that is defined in the model. You
cannot use non-primitive types such as Decimal because the value must be
encoded in the metadata. If you enter a name for a new type in this
property, a type will be added to the Unspecified Types section of UML
Model Explorer.
Visibility Public The permitted values, and the characters that appear in the signature are as
follows:
For more information, see Link model elements and work items.
Is Leaf False If true, it is not intended to allow redefinition of this attribute in derived
types.
Is Derived False If true, this attribute is calculated from other attributes. For example,
Diagonal, calculated from Width and Height. The details should be written
in the Description or an attached Comment.
Description (empty) For general notes, or for defining constraints on the values in the attribute.
Multiplicity 1
1..* - this attribute's value is a collection that contains at least one value.
Is Ordered False If true, the collection forms a sequential list. For Multiplicity of more than
1.
Is Unique False If true, there are no duplicate values in the collection. For Multiplicity of
more than 1.
See Also
UML Class Diagrams: Reference
Properties of types on UML class diagrams
Properties of operations on UML class diagrams
UML Class Diagrams: Guidelines
UML Class Diagrams: Guidelines
Share
Microsoft Azure
More...