Libraries and Components

Libraries and Components

 

 

This section describes the component editor. The topics are as follows:

A component is an element contained in a library that can be shared across projects, much like a routine in a code library.

A component is defined in a generic activity chart, which is a special activity chart that enables you to define global activities that can be shared within a specific project.

The definition of a component includes three parts:

Top-level name and inputs/outputs - The top-level design contains information on the component’s name and inputs/outputs. If the top-level design is changed, all charts that contain instances of that component must be modified by you (as a change here will cause changes to the charts). Use the Check Model tool to detect instances that are not up to date.
Behavior - The behavior of the component is reflected in all the versions of charts that use the component. If the behavior is changed, you do not have to update the graphic editors that contain instances of that component. Analysis tools automatically sense the new behavior, as well.
Icon - The icon is a pixmap that represents the component in the Component Browser. A one-line text is attached to the pixmap to enable you to attach a description to the component. The system then automatically attaches this description of the top-level activity of the generic chart to be the description of the component.

If the icon is changed, you do not have to update the graphic editors that contain instances of that icon’s component. Analysis tools (such as Simulation) do not sense the modification, but the Component Browser is refreshed with the new icon.
Note: Global definition sets (GDSs) can be part of a component. When you create a component, the related GDSs are automatically added to the component's configuration. (A GDS is related if it contains user-defined types or constants that are part of a component definition.).

When you delete a chart from the workarea, GDSs that are no longer relevant (because the last instance of a specific component was deleted) are automatically deleted from the workarea, as well.

Note the following behavior relevant to components:

The Check Model tool tests the legality of an instantiation of a component by comparing the flows in the activity charts against the component’s specification. Check Model does not “dive” into the components themselves, however.
The Reports tool reports on the instances themselves, and like all kernel tools, sees only the specifications of components. The Reports tool does not “dive” into the components themselves.
Dictionary and protocol reports list instances of components with their stubs and their type definition and the short and long descriptions of the components.
The Simulator tool can simulate components. The Simulator loads the body of components into the database. This is transparent to all other Rational Statemate tools, except the graphic editor in the case that a highlight was explicitly required by you.

When the Simulation preference Have Access to Component Elements is set to Yes (default is No), access to internal elements in the component is enabled (within Monitors, Do actions, Highlight GEs etc.)
The Software Code Generators support components. The Code Generators load the body of components into the database. This is transparent to all other Rational Statemate tools.