Book a Demo
Prev Next

Attributes

Attributes define the properties or internal data elements of an element. Not all element types support attributes, and others have restrictions; for example, attributes of Interfaces must have Public scope. In the Browser window, elements with attributes (typically Classes) have their attributes listed under the element name, each preceded by a blue box (Attribute icon). When depicted in diagrams, the attributes are listed in the first properties compartment of the element, as shown in this Customer Class example.

A UML Class element with several compartments, including an attribute compartment.

Attributes themselves have several important characteristics, such as type, visibility (scope), derivation and notes.

Access

Ribbon

Design > Element > Features > Attributes (Features window)

(Click on an attribute) Design > Element > Features > Features Dialog ('Attribute' dialog)

Context Menu

These options display the 'Attribute' dialog

  • Right-click on the attribute in the 'Project' tab of the Browser window | Properties | Properties
  • Right-click on the attribute in the 'Details' tab of the Inspector window | Edit <attribute name>
  • Right-click on the attribute in a diagram | View Properties

These options display the Features window:

  • Right-click element in Browser window or diagram | Features | Attributes or
  • Right-click attribute in Browser window | Properties | All Features

Keyboard Shortcuts

These options display the Features window when you click on an element in the Browser window or a diagram:

  • F9  or
  • Ctrl+5

This option displays the Features window when you click on an attribute in the Browser window or a diagram:

  • Ctrl+5

This option displays the 'Attribute' dialog when you click on an attribute in the Browser window or a diagram:

  • F9

Other

  • In the 'Details' tab of the Inspector window, double-click on an attribute to display the 'Attribute' dialog
  • In the 'Project' tab of the Browser window, double-click on an attribute to display the parent element on a diagram

Maintain Attributes

Action

Detail

See also

Create and Modify Attributes

On the 'Attributes' page of the Features window, you can create and modify attributes.

Create and Manage Attributes Attribute Tagged Values

Move and Copy Attributes

You can copy or move existing attributes between elements, if the target element also supports attributes.

Copy Features Between Elements Move Features Between Elements Using the Element Tab of the Browser

Define Properties

You can create property implementations specific to your coding languages for each attribute.

Create Properties

Identify Inherited Attributes

The attributes of an element can be inherited from one or more successive parent elements in the model. On a diagram, you can show which attributes are inherited from which 'owning' element in the hierarchy.

Display Inherited Attributes

Notes

  • Attributes, with Operations, Receptions, Interaction Points and Connection Points, are collectively referred to as Features of an element
  • If you are creating many attributes, go to the 'Attribute/Operations' page of the 'Preferences' dialog ('Start > Appearance > Preferences > Preferences > Source Code Engineering > Attribute/Operations') and de-select the 'After save, re-select edited item' checkbox; now, when you create an attribute and click on the Save button, the 'Attribute' page fields clear ready for you to enter the details of the next attribute - this helps you when you want to create attributes quickly and might not necessarily want to fully define each one as you create it
  • If the parent element provides source or target roles for a connector, the connector can be attached to a specific attribute (as a feature)
  • An alternative method of creating relationships between elements and attributes is to drag an attribute onto an Activity diagram, which generates an Object element named after the attribute; you then create relationships to and from this Object element

Learn more