Attributes

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. You can specify an attribute's type, for example as an integer or Boolean, and its initial value. You can also attach a constraint to an attribute to define the range of values it holds.

Attribute names are short nouns or noun phrases that describe the attribute. The UML syntax for an attribute name incorporates information in addition to its name, such as the attribute's visibility, type, and initial value as shown in the following example.

visibility «stereotype» name : type-expression = initial-value

Example

In an e-commerce application, a Customer class has an attribute that holds the amount of money in the customer's balance as shown in the following example.

- balance : MoneyType = 0.00
Related tasks
Managing attributes and operations in classifiers
Adding attributes to classifiers in diagrams
Sorting and filtering specific attributes and operations
Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.