Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Create Use Case for Method
Using the code editor context menu, you can create a Use Case element for a method that you select from the code. You can also:
Create a Use Case for a method, through the code editor
Step |
Action |
See also |
---|---|---|
1 |
(If you want to depict the Use Case and its link to the method in a diagram) click on the diagram name in the Project Browser. |
|
2 |
In the code editor, right-click on either the method name or any part of the method body, and select the 'Create Method for <methodname>' option. The 'Create Use Case for Method' dialog displays. |
Code Editor Context Menu |
3 |
The basic function of this dialog is to create a Use Case for the selected method:
|
|
4 |
To create a Trace connector linking the Use Case to the method, select the Link Use Case to Method check box. |
|
5 |
To add the method's parent Class to the diagram, if it is not already there, select the Add Class to Diagram check box. |
|
6 |
To add the newly-created Use Case to the diagram, select the Add Use Case to Diagram check box; this would now show the Use Case, Class and Trace connector on the diagram. |
|
7 |
To only show the features (attributes and methods) of the parent Class that are the targets of 'link to feature' relationships, select the 'Display only linked features in Class' checkbox. The Class might contain any number of attributes and methods, but those without a 'link to feature' relationship are hidden. |
Connect to Element Feature |
8 |
Click on the to create and depict the Use Case and relationship; if you selected all options, the diagram now contains linked elements resembling this illustration:
|