Rational Software Corp.

TOC PREV NEXT INDEX



Component Diagrams and Specifications


Contents

This chapter is organized as follows:


Component Diagram Overview

A component diagram shows the physical dependency relationships (mapping to a file system) between components--main programs, subprograms, packages, and tasks--and the arrangement of components into component packages.

Figure 81 Component Diagram Example

Component diagrams are contained (owned) either at the top level of the model or by a package. This means the diagram will depict the components and packages in which the diagram is contained.

Creating and Displaying a Component Diagram

You can create or display the component diagram in one of three ways:

Component Diagram Toolbox

The application window displays the following toolbox when the current window contains a component diagram and View > As Unified is selected.

Figure 82 Component Diagram Toolbox

               

Assigning a Component to Another Package

Every component is assigned to a package. When you create a component using a creation tool from the component diagram toolbox, the component is assigned to the package containing the component diagram.

To reassign a component from one package to another:

1 Select a component icon in a diagram directly contained by the package to which the component should be assigned. (You might need to create such a diagram or icon if one does not currently exist.)

2 Click Edit > Relocate.

Rational Rose will update all component diagrams to reflect the component's new assignment.

Like components, packages are also assigned to packages, permitting nesting to an arbitrary depth. The mechanisms previously described can be applied to packages as well as components.


Component Specification

A Component Specification displays and modifies the properties and relationships of each component in the current model. The same specification is used for all kinds of components.

Some of the information on this specification can also be displayed inside icons representing the component in a component diagram.

To display a Component Specification, double-click any icon representing the component, or click Browse > Specifications.

Specification Content

The Component Specification consists of the following tabs: General, Detail, Realizes, and Files.

Component Specification--General Tab

Figure 83 Component Specification--General Tab

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

Stereotype (Component)

A component stereotype represents the subclassification of an element. The most common type of components are already predefined as stereotypes, including Main Program, Package Body, Package Specification, Subprogram Body, Subprogram Specification, Task Body, and Task Specification. You can also define and add your own kinds of stereotypes.

Language

This field identifies the implementation language that is assigned to this component. Note that when changing the implementation language of a component, the data types that are used in the specification of operations and attributes of the assigned classes are not automatically converted to data types in the new implementation language. Also, if you change the implementation language for a component with classes that are assigned to other components, a dialog box that allows you to specify how to handle those classes appears.

Component Specification--Detail Tab

Figure 84 Component 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.

Declarations

The Declarations field contains a list of declarations, such as class names, variables, and other language-specific features (such as #includes or similar constructs). Declarations can include classes, objects, and any other language-specific declarations.

Use this field to list the elements that physically reside in the component. You can view this field only through the component specification.

Component Specification--Realizes Tab

Figure 85 Component Specification--Realizes Tab

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

Show All Classes

Select this check box if you want to view a list of all classes in the model. If this check box is cleared, you will see only the classes that are assigned to this component.

Classes

The list identifies the classes and interfaces that are assigned to this component (indicated with check marks). The Logical Package column shows to which package a class belongs, and the Language column shows the programming language that is assigned to a specific class.

You assign a class or interface to a component through Assign on the shortcut menu in the list, or by dragging a class or interface from the browser and dropping it in this list. You can only assign classes that are unassigned or classes that are assigned to components with the same implementation language as this component.

Language

This field identifies the implementation language that is assigned to this component.

When changing the implementation language of a component, the data types that are used in the specification of operations and attributes of the assigned classes are not automatically converted to data types in the new implementation language. Also, if you change the implementation language for a component with classes that are assigned to other components, a dialog box is displayed in which you must specify how to handle those classes.

Component Specification--Files Tab

Refer to the descriptions in the Introduction to Specifications chapter for information on the specification elements.


Package Specification

A Package Specification displays and modifies the properties and relationships of a package in the current model.

To display a Package Specification, double-click any icon representing the package, or click Browse > Specifications.

The Package Specification consists of the following tabs: General, Detail, Realizes, and Files.

Package Specification--General Tab

Figure 86 Package Specification--General Tab

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

Package

The package the component belongs to is displayed in this static field.

Package Specification--Detail Tab

Figure 87 Package Specification--Detail Tab

Component Diagrams

This field lists the component diagrams contained in the package. You can create a new component diagram in the package through Insert on the shortcut menu, or click Browse > Component Diagram. You may rename or delete existing component diagrams from this field.

To display a specific component diagram listed in this field, double-click its entry.

Package Specification--Realizes Tab

Refer to description earlier in this chapter for information on this tab.

Package Specification--Files Tab

Refer to the descriptions in the Introduction to Specifications chapter for information on the specification elements.


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