Rational Software Corp.

TOC PREV NEXT INDEX



Class Specification--Detail Tab

Class Specification--Detail Tab

Figure 19 Class Specification--Detail Tab

Refer to the descriptions in the Introduction to Specifications chapter for information on the specification elements not covered in the following section.

Cardinality

The Cardinality field specifies the number of expected instances of the class. In the case of relationships, this field indicates the number of links between each instance of the client class and the instance of the supplier. You can set a specific cardinality value for the client class, supplier class, or both.

Use the following syntax to express cardinality.

Table 6 Cardinality Field Options
Type

Description

n (default)
Unlimited number of instances
1
One instance only
0..n
Zero or more instances
1..n
One or more instances
0..1
Zero or one instance
<literal>1
Exact number of instances
<literal>..n
Exact number or more instances
<literal>..<literal>
Specified range of instances
<literal>..<literal>,<literal>
The number of instances will be in the specified range or an exact number of instances
<literal>..<literal>, <literal>..<literal>
The number of instances will be in one of the specified ranges
1 Where <literal> is any integer greater than or equal to one.

To display class cardinality on an icon, right-click the icon and select a cardinality through the shortcut menu. A literal value can only be specified on the specification.

Space

Use the Space field to document the amount of storage required by objects of the class during execution.

Persistence

Persistence defines the lifetime of the instances of a class. A persistent element is expected to have a life span beyond that of the program or one that is shared with other threads of control or other processes. Use this field to identify the persistence for elements of this class.

Table 7 Persistence Field Options
Type

Description

Persistent (Default)
The state of the element transcends the lifetime of the enclosing element.
Transient
The state and lifetime of the element are identical.
Static
The element exists during the entire execution of a program.

The persistence of an element must be compatible with the persistence that you specified for its class. If a class persistence is set to Persistent, then the object persistence is either persistent, static, or transient. If a class persistence is set to Transient, then the object persistence is either static or transient.

You can set the persistence only through the specification. This field is inactive for class utilities, parameterized class utilities, and instantiated class utilities.

To set the persistence, click the applicable option in the Persistence field. You can display the persistence in the diagram by clicking Show Persistence from the shortcut menu.

Concurrency

A class concurrency defines its semantics in the presence of multiple threads of control.

Table 8 Class Concurrency Options
Type

Description

Sequential (default)
The semantics of the operation are guaranteed only in the presence of a single thread of control. Only one thread of control can be executing in the method at any one time.
Guarded
The semantics of the operation are guaranteed in the presence of multiple threads of control. A guarded class requires collaboration among client threads to achieve mutual exclusion.
Active
The class has its own thread of control.
Synchronous
The semantics of the operation are guaranteed in the presence of multiple threads of control; mutual exclusion is supplied by the class.

Abstract

The Abstract check box identifies a class that serves as a base class. An abstract class defines operations and states that will be inherited by subclasses. This field corresponds to the abstract class adornment displayed inside the class icon.

To toggle the abstract adornment, select or clear the abstract check box in the Class Specification.

When you click Abstract and you view the model in Booch notation, the abstract class adornment is displayed in the lower left corner of the class icon.

You can change the abstract class adornment only through the specification.

The Abstract field is inactive for metaclasses, class utilities, parameterized class utilities, and instantiated class utilities.

Formal Arguments

In the Parameterized Class or Parameterized Class Utility Specification, the formal, generic parameters declared by the class or class utility are listed.

In the Instantiated Class or Instantiated Class Utility Specification, the actual arguments that match the generic parameters of the class being instantiated are listed.

You can add, update, or delete parameters only through the Class Specification. This field applies only to parameterized classes, parameterized class utilities, instantiated classes, and instantiated class utilities.

To define the parameters for a class, position the pointer within the Parameters field and click Insert from the shortcut menu or press the insert key.

Parameters are displayed on class diagrams.


Rational Software Corporation  http://www.rational.com
support@rational.com
docs@us.ibm.com
Copyright © 1993-2000, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX