Use Case
Last updated
Was this helpful?
Last updated
Was this helpful?
The use_case is the meat of use case diagrams. It is a set of behaviors that will be performed by an actor or actors in the diagram.
There are two methods for declaring a use_case. One method uses the command word usecase. The other method requires placing the name of the use case inside parentheses.
Use cases have eight properties. All are optional except description. The properties generally follow the below order.
description - explains the action performed in the use case
business - determines if the use case is a business use case
alias - gives the ability to use a variable to identify the use case
stereotype - applies a stereotype text to the use case
fill_color - changes the interior color of the use case
line_color - determines the color of the line used to draw the use case
line_type - determines the type of line used to draw the use case
text_color - determines the color of the description and stereotype text
The business property may come before or after description. The last four properties follow a hash (#) sign and are separated by a semicolon (;) if more than one is used. The last three properties can be in any order so long as they are the last three.
The description is text that appears inside the use_case oval. The description can be a single word or it can be a string. Multiword strings must be inside parentheses. The string method supports line breaks as well as markup for color and emphasis. You can define colors with a standard color name or hex code.
The business property is turned on by placing a forward slash after the usecase command or after the last parentheses around description.
The alias is exactly that. It is a variable that represents a use_case. It is especially useful if the use_case has a long description. The variable for the alias follows the as keyword.
There will be an actor and an association in the following example. This is needed to show the importance of the alias. They will not be explained here. See their respective sections of this chapter for proper explanations.
Notice how much easier it is to create an association with the Clock alias on line 15. Otherwise you must write the entire description as shown for Stock Shelves on line 18.
Example: Use Case Alias
The stereotype field is defined by text between a double set of greater than and less than signs. This adds stereotype text above the description inside the oval icon. The stereotype text will be displayed in the color of the text_color property.
The fill_color is defined by a standard color name or hex code. It determines the interior color of the actor icon. For the standard stick figure this is the interior of the head. If you use this property at all it must come immediately after a hash (#) sign and touch the hash sign. If any other properties follow this place a semicolon (;) between them. No spaces are needed.
The line_color is defined by a standard color name or hex code. It determines the color of the line that defines the outer edge of the use_case oval icon. If you use this property alone it must come after a hash (#) sign and touch the hash sign. If any other properties follow this place a semicolon (;) between them. No spaces are needed.
The line_type defines the texture of the exterior line of the use_case icon. If you use this property alone it must come after a hash (#) sign and touch the hash sign. If any other properties follow this place a semicolon (;) between them. No spaces are needed.
The line_types are as follows.
line.bold
line.dashed
line.dotted
The text_color is defined by a standard color name or hex code. It determines the color of the description and the stereotype. If you use this property alone it must come after a hash (#) sign and touch the hash sign. If any other properties follow this place a semicolon (;) between them. No spaces are needed.
Note: If color formatting is used inside of the description property it will override text_color.
You can use multiple lines to create a very descriptive use_case. For this we will swap the order of the description and alias properties. The description can take up several lines but must be inside of quotation marks. Special description supports markup for color and emphasis. You can define colors with a standard color name or hex code.
One other feature of the special description is that it supports visual separators. The separators can stand alone by placing two of the separator characters on a line. Or the visual separator can encompass text by wrapping the text in two sets of two characters. The four types of separators are shown below.
-- - creates a dashed separating line
.. - creates a dotted separating line
== - creates a double lines separator
_ _ - creates a solid line separator
Note: Vertical empty space inside the special description will appear in the diagram. See lines 13 and 15.
Note: Special Description does not support any other use_case properties.
Note: If color formatting is used inside of the description property it will override text_color. See for example.