Model element properties

Properties define characteristics of model elements in UML diagrams. For example, you can set the concurrency property for an object to specify how it coordinates with other objects. You can set the multiplicity property to specify how many values can be associated with a model element. You can also set the type and visibility properties to specify whether a model element is a string or integer, or has public or private visibility.

Concurrency

The concurrency property of an operation in an active object specifies how a system behaves when another active object calls the operation.

The concurrency property is relevant only if your application has active objects, processes, or threads. You can set the concurrency property on operations that belong to the active objects in your application.
Concurrency value Description
Sequential This value is the default for an operation's concurrency property. Conflicts can occur between concurrent processes. Objects that call this operation must coordinate with each other to ensure that the operation is called only once at a time.
Guarded Multiple calls to an operation can occur simultaneously, only one of which is allowed to proceed. Subsequent calls are blocked until the first call completes. System designers should ensure that applications can simultaneously block calls to operations.
Concurrent Multiple calls to an operation can occur and proceed simultaneously.

Multiplicity

The multiplicity property applies to several model elements, but particularly to attributes that belong to classifiers, composite structure diagram parts, and to associations between classifiers. An attribute's multiplicity tells you how many values you can associate with that model element. For example, you can define an attribute called Attribute1 of data type Integer that can have a range of integer values from 0 to 3 such as, Attribute1 : Integer [0..3]. A multiplicity value, or range of values, on an association end shows the number of objects that can participate in the relationship. A multiplicity specification can be a single positive integer, a range of positive integers that are specified by lower and upper limits, or a comma-separated list of positive integers. An asterisk indicates an unlimited upper limit. For example, the following table shows several multiplicity specifications:

Example Description
1 Exactly one
0..1 Zero or one
* Any number, including zero
n Any number, including zero
1..* One or more
Note: When you use the en (n) multiplicity notation in the product, the en is converted to an asterisk (*).

In a context with parameters such as a template, the upper and lower limits of a multiplicity specification can be expressions that evaluate to integer values.

As the following figure illustrates, when multiplicity values are associated with an attribute, they appear in brackets:

Attribute named Attribute1 with multiplicity values 0..3 in brackets.

As the following figure illustrates, when multiplicity values are associated with parts in composite structure diagrams, they also appear in brackets:

A diagram of a part called PartName with multiplicity values in brackets.

As the following figure illustrates, when multiplicity values are associated with association ends, they are shown beside the association ends to which they apply:

Two classifiers related by an association which displays multiplicity specifications at its ends.

Type

You can specify the type of an attribute, an operation, a parameter, and an association end. The type that you specify can be a class, an interface, or a UML data type such as integer, string, unlimited natural, or Boolean.

Visibility

Visibility determines whether model elements can gain access to other model elements from within the same class, the same package, an inheritance structure, or from anywhere in an entire system. You can specify visibility for the following model elements:
  • Attributes and operations that belong to a classifier
  • Classifiers that belong to a package
  • Association ends that belong to association relationships that connect two classifiers

For example, other classes can see and use the attributes and operations in a class with public visibility. If attributes and operations have private visibility, only the class that contains them can see and use them.

Visibility specifiers in UML are the same as those in many object-oriented programming languages. You can use icons or text symbols to show the level of visibility for attributes and operations. A text symbol such as a number sign (#) beside the name of an association end shows the visibility of that association end.
Level Attribute icons Operation icons Text symbol Description
Public An attribute named Attribute1 is adjacent to a small hollow green circle denoting public visibility. An operation named Operation1 is adjacent to a small solid green circle denoting public visibility. + Model elements that can see the container can also see and use the public model element.
Private An attribute named Attribute1 is adjacent to a small hollow red square denoting private visibility. An operation named Operation1 is adjacent to a small solid red square denoting private visibility. - Model elements that are in the same container can see and use a private model element of that container.
Protected An attribute named Attribute1 is adjacent to a small hollow yellow diamond denoting protected visibility. An operation named Operation1 is adjacent to a small solid yellow diamond denoting protected visibility. # Model elements that are in the same container, or in a descendant of the container, can see and use a protected model element of that container.
Package An attribute named Attribute1 is adjacent to a small hollow blue triangle denoting package visibility. An operation named Operation1 is adjacent to a small solid blue triangle denoting package visibility. ~ Model elements that are in the same package as the container can see and use a model element with package visibility.

Feedback