Show the other guides in this set
Table of Contents Previous section Next section

Working With Items

Items and components

When you draw a symbol in a diagram editor, you create a component, which is a graphical element in the repository. When you specify property values for the component, you create an item, which is a semantic element in the repository. Diagram names are also items.

Implicit and explicit properties

You describe items and components by specifying their implicit and explicit properties.

Identified by name and type

An item is identified by its name and its type.

Purpose of items

Items allow different graphical elements to refer to the same semantic element.

Example

When you create the Rental class in a CD, you create an item with the name Rental and type cl. By default, the UML suite associates this item with any other Rental class that you create in any other diagram in the same Phase.

Qualified items

Qualified items belong to another item. Operations and classes, for example, are both items. Because an operation always belongs to a class, an operation is a qualified item. The name of a qualified item consists of the owner item name and the qualified item name. For example, the getName operation on the Member class is named Member.getName.

The names of the following diagram types are also qualified by a class name: activity (AD), collaboration (COD), sequence (SD), and statechart (STD). For example, a Statechart diagram for the Member class might be named Member:lifecycle.

Defining and Viewing Items

Items and components

A graphical element in a diagram editor is a component. A semantic element in the repository is an item. In a complete model, each component is linked to an item.

How to define an item

ÿ To define an item explicitly:

  1. Open a diagram, for example, a Sequence Diagram.
  2. Add a component to the diagram; for example, add an object to the Sequence Diagram.
  3. Select the component; for example, select the object.
  4. Select Item | Edit Properties.
  5. In the left pane of the Edit Properties dialog box, select the item.

    The item properties appear in the right pane.

  6. Click Define Item.

    Note: If the item exists, the Define Item button appears dimmed.

Implicit definition of items for classes

When you create a class in a CD, you often specify its attributes and operations before specifying its properties. When you add an attribute or operation to a class symbol, the UML suite defines the class item. Therefore, you rarely use the previous procedure to define class items.

How to view items

You can view items using the Browser or reports:

Renaming Items

Editing a label does not rename an item

Editing the label of a component creates a new item. It does not change the name of the item. To change the name of an item, you must rename it using either File | Change | Name in the Browser or Edit | Change Name in a diagram editor.

Renaming an item can affect multiple objects

In the UML suite, the names of diagrams and most diagram components are stored as items. For example, the name of a CD and the name of a class are both stored as items of type cl. If two items of the same type have the same name, they are the same item. For example, if a CD and a class have the same name, they refer to the same item. Changing the name of one also changes the name of the other.

Appendix B, Type and Scope of Diagram Components, lists the item type of diagram names and diagram components.

How to rename an item from the Browser

ÿ To rename a diagram item from the Browser:

  1. In the Browser, move to the package that defines the item that you are interested in.
  2. Select View | Defined Items.
  3. In the information area, select the item that you want to rename.
  4. Select File | Change | Name.
  5. In the Change Name dialog box, type the new name and click OK.

How to rename an item from the diagram editor

When you rename an item, the UML suite updates the repository immediately. The new item name remains even when you close the diagram without saving changes.

ÿ To rename an item from a diagram editor:

  1. Open the diagram in which the item is defined.
  2. Select the object whose name you want to change or in which the object whose name you want to change appears.
  3. Select Edit | Change Name.

    Note: If more than one item is associated with the selected object, the Items dialog box appears. Select the item and click OK.

  4. In the Change Name dialog box, type the new name and click OK.

Specifying Scope

Definition

An item's scope defines its name space and where it is defined. You specify an item's scope as Phase, Package, or File.

Appendix B, Type and Scope of Diagram Components, lists the item type and initial scope of each diagram component. An item keeps its initial scope unless you change it.

Scope and item name space

Scope defines the range within which an item's name must be unique.

Scope and item definitions

Scope also defines where an item's definition is stored. (Qualified items always have the same scope as the owner item.)

Editing items

Generally, if you can see an item in a diagram editor, and the diagram editor is not loaded read-only, you can edit the item. The following items are useful to keep in mind when editing:

Locating items

On each level, at most one item with a given name and type can exist. The levels form a nested structure -- file, package, phase -- in which items can be found. Items are searched for (by name and type) starting at a given level. If the item is not present at that level, the UML suite searches the next highest level until a matching item is found, or the highest level is reached.

How to change an item's scope

Note: When you change an item's scope, the UML suite updates the repository immediately. The item's new scope remains even if you close the diagram without saving changes.

ÿ To change an item's scope:

  1. In the diagram, select the object.
  2. Select Item | Edit Scope.

    Note: If more than one item is associated with the selected object, the Items dialog box appears. Select the item and click OK.

  3. In the Edit Scope dialog box, select an option. The options that appear depend on the type and scope of the selected item. Then click OK
    An item's scope determines where its definition is stored. Changing its scope can change its definition. Use the options to determine the item definition for the new scope.

Changing the scope downward

Changing the scope downward means changing it from a higher level to a lower level, for example, from Phase to Package. Typically, when you change the scope downward, you copy the item definition. The item definition also remains on the higher level. The Edit Scope dialog box, presents the following options:

Option Scope Change
Create empty definition on File/Package level Create a new item definition, with default property values, in the current file or package. System to File Phase to File Phase to System
Copy definition to File/Package level Copy the existing item definition, including its property values, to the current file or package. System to File Phase to File Phase(Ref) to System
Restrict definition to Package level Item is defined in the current package. Do not modify item definition; instead change scope. Phase(Def) to System

Changing the scope upward

Changing the scope upward means changing it from a lower level to a higher level; for example, from Package to Phase. Typically, when you change the scope upward, you move the item definition. The Edit Scope dialog box presents the following options:

Option Scope Change
Export definition to Package/Phase level Move the existing item definition, including its property values, to the current package. The item definition in the file is deleted. File to System File to Phase(Def)
Make definition available on Phase level Item is defined in the current package. Do not modify item definition; instead change scope. System to Phase(Def)
Refer to (not yet existing definition) on Package level Create a new item definition, with default property values, in the current package. The item definition in the file is deleted. File to System
Refer to (not yet existing definition) on Phase level The item definition in the file is deleted. The item is undefined. File to Phase(Ref)
Refer to definition on Phase level The item definition in the file is deleted. The item definition exists in another package. Note: If the item is a class and the package contains the CDM, the item definition cannot be deleted; the scope cannot be changed. Package to Phase(Ref)

Note: If you attempt to create an item definition in a package that already contains a definition for that item, an error message appears. You must delete the existing definition before you can create a new one.

Removing and Moving Items

Purpose

You can remove items that are no longer referenced and move item definitions from one package to another.

Removing unreferenced items

When you name a diagram component, you create an item. If you delete the diagram symbol, the item remains in the repository and can be used in other diagrams. If you do not use the item, removing it from the repository improves performance and avoids unexpected name conflicts.

How to remove unreferenced items

ÿ To remove unreferenced items:

  1. In the Browser, move to the appropriate level.
  2. Select the packages or files from which you want to remove unreferenced items.
  3. Select Utilities | Delete Unreferenced Items.

Also available from diagram editors

Use Utilities | Delete Unreferenced Items to remove unreferenced items from the current diagram file.

To move an item definition

You can move the definition of any unqualified item that has scope phaseDef from one package to another. When you move an item's definition, the definitions of all items that it qualifies are also moved.

ÿ To move an item definition:

  1. In the Browser, move to the package that defines the item that you are interested in.
  2. Select View | Defined Items.
  3. In the information area, select the items you want to move.

    Note: You can only select items with scope phaseDef.

  4. Select Utilities | Move Definition.
  5. In the Move Definition dialog box, select the package that you want to move the selected items to, and then click OK.



Table of Contents Previous section Next section


Copyright © 2000, Telelogic AB. All rights reserved.