Sie sind auf Seite 1von 4

Properties of attributes on UML class diagrams Pgina 1 de 4

> Analyzing and Modeling Architecture > Create models for your app >

Properties of types on UML class


diagrams Properties of
Properties of attributes on UML attributes on UML
class diagrams

Properties of operations on UML


class diagrams
class diagrams Visual Studio 2015 Other Versions

Properties of associations on UML


class diagrams

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:

+ AttributeName : TypeName [*]

+ denotes public Visibility. The other permitted values are - (private), # (protected), ~ (package).

AttributeName is underlined if the attribute is static.

: TypeName is omitted if the attribute has no type.

[*] denotes the multiplicity. It is omitted if the multiplicity is 1.

Properties
The following table describes the properties of an attribute in a class or interface on a UML class diagram.

mhtml:file://C:\Users\user\Documents\Properties of attributes on UML class diagrams... 31/07/2017


Properties of attributes on UML class diagrams Pgina 2 de 4

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.

To view the properties of an attribute, right-click it and then click Properties.

Property Default Description

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.

If true, the name of the attribute is underlined where it appears on the


diagram.

Name (a new name) Should be unique within the owning classifier.

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:

+ Public - visible globally

- Private - not visible outside the owning type

# Protected - visible to types derived from the owner

~ Package - visible to other types within the same package.

Work Items 0 associated Count of associated work items. Read-only.

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

mhtml:file://C:\Users\user\Documents\Properties of attributes on UML class diagrams... 31/07/2017


Properties of attributes on UML class diagrams Pgina 3 de 4

Property Default Description

1 - this attribute has a single value of the specified Type.

0..1 - this attribute can have a value of null.

* - this attribute's value is a collection of values.

1..* - this attribute's value is a collection that contains at least one value.

n .. m - this attribute's value is a collection that contains between n and m


values.

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

Print

Share

Dev centers Learning resources Community Support


Microsoft Virtual Academy Forums Self support
Windows
Channel 9 Blogs
MSDN Magazine Codeplex
Office
Programs
BizSpark (for startups)
Visual Studio
Microsoft Imagine (for students)

Microsoft Azure

More...

United States (English) Newsletter Privacy & cookies Terms of use


Trademarks 2017 Microsoft

mhtml:file://C:\Users\user\Documents\Properties of attributes on UML class diagrams... 31/07/2017


Properties of attributes on UML class diagrams Pgina 4 de 4

mhtml:file://C:\Users\user\Documents\Properties of attributes on UML class diagrams... 31/07/2017