Synthesizing diagrams from imported type libraries

About this task

Once you have imported a type library, you can create an object model diagram from it to show its internal structure.

Note: The following example shows the object model diagram that can be synthesized from the import of the IBM® Rational® Rhapsody® type library (rhapsody.tlb), which is shipped with Rational Rhapsody and encapsulates the Rational Rhapsody COM API.

Do the following:

Procedure

  1. Import the rhapsody.tlb type library from the root directory of your Rational Rhapsody installation.
  2. In the main toolbar, click the Object Model Diagram tool.
  3. In the Open Object Model Diagram window, click New.
  4. In the New Diagram window, enter a name for the new diagram and check the Populate Diagram option. Click OK.
  5. In the Populate Diagram window, select the package containing the imported type library (in this case, rhapsody) so all the interfaces contained in the library are included in the diagram.
  6. Click OK.

    The following figure shows the result, an object model diagram showing the structure of the rhapsody type library and its interfaces. These interfaces are used in the COM API.

  7. Zoom in on the diagram. You can see that:
    • The Rational Rhapsody type library is represented as a package named rhapsody with a stereotype of «COM Library».
    • Each interface is represented as a class with a stereotype of
      «COM Interface».

Results

Examine the features of some of the imported «COM Interfaces» to see that their attributes and operations have been imported. Note their types.

Examine the properties of some of the imported «COM Interfaces» to see how the COM properties have been set for imported elements.


Feedback