Rational Software Corp.

TOC PREV NEXT INDEX



Introducing Rational Rose Ada


Contents

This chapter is organized as follows:


What is Code Generation?

Rose Ada provides the Ada Generator to generate Ada units from information in a Rose model. These units contain Ada code constructs that correspond to the notation items (classes, relationships, and adornments) you have defined in the model using diagrams and specifications. Rose Ada supports either Ada 95 or Ada 83 code generation with the Ada 95 or the Ada 83, respectively, add-in to Rational Rose. The commands for the Ada Generator are located in the Ada 95/Ada 83 submenu of the Rose Tools menu.

The Ada Generator provides code-generation properties that control the kinds of Ada code constructs that are generated for the various kinds of notation items in the model. You can use the default values for these properties or you can specify different values to generate the code you want.

Using Code Generation

To generate Ada 95 code:

1 Activate the Ada 95 add-in using the Add-In Manager, which is accessible from the Add-Ins menu.

2 Set the default language for your model to be Ada 95. Do this by clicking Tools > Options and click the Notation tab.

3 In the Default Language list, select Ada 95.

To generate Ada 83 code:

1 Activate the Ada 83 add-in using the Add-In Manager, which is accessible from the Add-Ins menu.

2 Set the default language for your model to be Ada 83. Do this by clicking Tools > Options and click the Notation tab.

3 In the Default Language list, select Ada 83.

You may generate a different language for some classes by associating them with a component that has a different language.


What is Reverse Engineering?

Reverse Engineering generates a model from compiled code.

Rose can analyze Ada code compiled with Rational Apex and generate a Rose model containing class and component diagrams that present a high-level view of the code.

This capability is only available for Ada units that have been compiled with the Apex compiler and that are in the installed (analyzed) or coded states.

The reverse engineering tool can create both class diagrams and component diagrams. Class diagrams show the high-level relationships between Ada units and types, and the operations and data structures associated with each type. Component diagrams come in two forms:

Each view displays the "with" structure of the Ada units in that view.

Using Reverse Engineering

Select the Ada unit or view you wish to diagram, and click Rose > Ada > Reverse Engineer. The Reverse Engineer dialog box appears, allowing you to modify various options. Click OK or Apply to create the model file.

Once you have created the model file, you can load it into Rose. Select the file in the directory viewer (you may need to click File > Redisplay first). Then choose Start Rose from the Rose > Ada submenu. This will invoke Rose and display the model.

Note: For traversal to work, you must invoke Rose from the Apex menu. If Rose is already running before you started Apex, exit Rose and restart from the Apex menu command.



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