Creating usage relationships between C/C++ elements

You can add a usage relationship between a C/C++ header file (which has .h has a file name extension) and a CPP class file (which has .cpp as a file name extension) in a domain modeling class diagram, and add #includes to the code.

Before you begin

You must be in the C/C++ perspective and have a class diagram open in the diagram editor.

About this task

To create a usage relationship in a class diagram, complete the following steps:

Procedure

  1. In the Palette, click #includes (Usage).
  2. In the diagram editor, click a C/C++ header file and drag the cursor to a CPP class file.

Results

A «use» relationship is created between the two C/C++ elements in the diagram and #includes is added to the code.

Feedback