Model element properties

You can set the concurrency, multiplicity, type, and visibility properties of model elements.

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. Calling objects should coordinate with each other so that only one call to an operation occurs 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 vales 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
1.. One or more

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.

When multiplicity values are associated with an attribute, they appear in brackets, as in the following example:

An attribute is displayed which is called Attribute1. The attribute is an integer and has public visibility. It also has a multiplicity specification, with values of zero to three, that appears in brackets beside the type of the attribute.

When multiplicity values are associated with parts in composite structure diagrams, they appear in brackets, as in the following example:

A part in a composite structure diagram is displayed which is called PartName. The part contains a multiplicity specification of one to three that appears in brackets after the name of the part.

When multiplicity values are associated with association ends, they are shown beside the association ends to which they apply, as in the following example:

Two classifiers are displayed which are called ClassifierOne and ClassifierTwo. The classifiers are related by an association which has a multiplicity specification of one to three at the ClassifierOne end and an asterisk (*) at the ClassifierTwo end.

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; a UML data type such as integer, string, unlimited natural, or Boolean; or an interface.

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:

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 Icons for attributes Icons for operations Text symbol Description
Public An attribute, called Attribute1 is displayed. The attribute has a small hollow green circle on the left, which indicates that the attribute has public visibility. An operation, called Operation1, is displayed. The attribute has a small solid green circle on the left, which indicates that the operation has public visibility. + Model elements that can see the container can also see and use the public model element.
Private An attribute, called Attribute1 is displayed. The attribute has a small hollow red square on the left, which indicates that the attribute has private visibility. An operation, called Operation1, is displayed. The attribute has a small solid red square on the left, which indicates that the operation has private visibility. - Model elements that are in the same container can see and use a private model element of that container.
Protected An attribute, called Attribute1, is displayed. The attribute  has a small hollow yellow diamond on the left, which indicates that the attribute has protected visibility. An operation, called Operation1, is displayed. The attribute has a small solid yellow diamond on the left, which indicates that the operation has 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, called Attribute1, is displayed. The attribute  has a small hollow blue triangle on the left, which indicates that the attribute has package visibility. An operation, called Operation1, is displayed. The attribute has a small solid blue triangle on the left, which indicates that the operation has package visibility. ~ Model elements that are in the same package as the container can see and use a model element with package visibility.

Parent topic: Class diagrams

Terms of use | Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.