UML Use Case Diagrams - Tips
UML Use Case Diagrams - Tips
UML Use Case Diagrams - Tips
Contents:
What is a UML Use Case Diagram (UCD), and when should I use it?
I am trying to represent a sequence of actions that the system performs. How do I do it?
How is a UML Use Case Diagram different from a traditional flow chart?
The scenario I want to describe branches into several possible outcomes, or has some
error conditions. How can I represent that with Use Case Diagrams?
What is a UML Use Case Diagram (UCD), and when should I use it?
Back to top
Back to top
The system box only appears on the top-level diagram (remember that a
typical UML
Use Case description will be composed of many diagrams and
sub-diagrams), and
should contain use case ovals, one for each
top-level service that your system provides
to its actors. Any
kind of internal behavior that your system may have that is only used
by other parts of the system should not appear in the system
box. One useful way to
think of these top-level services is as
follows: if a use case represents a top-level
service, then it should
make sense for the actors who interact with it to request only
https://www.andrew.cmu.edu/course/90-754/umlucdfaq.html#top 2/14
م1:21 2022/10/10 UML Use Case Diagrams: Tips
that
service of your system in a single session (in whatever sense a
"session" is
intelligible in your system.)
Back to top
https://www.andrew.cmu.edu/course/90-754/umlucdfaq.html#top 3/14
م1:21 2022/10/10 UML Use Case Diagrams: Tips
If there are interactions between the actors in your system, you cannot represent those
interactions on the same diagram as your system. What you can do instead is draw a
separate UCD, treating one of the actors itself as a system, and your original system
(along with the other actors) as actors on this new diagram.
Example: Suppose you wanted to diagram the interactions between a user, a web
browser, and the server it contacts. Since you can only have one system on the
diagram, you must choose one of the obvious "systems", such as the server. You might
then be tempted to draw interaction lines between the actors, but this is a problem
because it isn't clear what the interaction means, so it isn't helpful to show it here. A
more useful solution would be to draw two diagrams, showing all of the interactions, as
below.
Back to top
https://www.andrew.cmu.edu/course/90-754/umlucdfaq.html#top 4/14
م1:21 2022/10/10 UML Use Case Diagrams: Tips
Using a UML Use Case Diagram, you can't. UCDs are meant to be a
top-down,
horizontal description of functionality, not a blow-by-blow
desrciption of behavior. For
the most part, it isn't a good idea to
try to represent sequences of actions with Use Case
diagrams. You
should use a Sequence Diagram or a traditional flow chart instead.
(It is
possible to represent simple branching conditions with a UCD,
as described below, but
you should use this technique sparingly
because it can render a diagram unreadable.)
Back to top
https://www.andrew.cmu.edu/course/90-754/umlucdfaq.html#top 5/14
م1:21 2022/10/10 UML Use Case Diagrams: Tips
https://www.andrew.cmu.edu/course/90-754/umlucdfaq.html#top 6/14
م1:21 2022/10/10 UML Use Case Diagrams: Tips
Back to top
Back to top
https://www.andrew.cmu.edu/course/90-754/umlucdfaq.html#top 8/14
م1:21 2022/10/10 UML Use Case Diagrams: Tips
https://www.andrew.cmu.edu/course/90-754/umlucdfaq.html#top 9/14
م1:21 2022/10/10 UML Use Case Diagrams: Tips
Back to top
Probably the best way to think about these diagram elements is as follows:
UCs used by a
use case MUST BE DONE before that use case be considered to be
complete. Once you realize that there are several types of seat
assignment, you might
be tempted to draw a diagram using the
uses edge like the one below, but this doesn't
make sense: This
diagram says that in order to assign a seat you must assign both a
window seat AND an aisle seat to the passenger. Never fear, however;
this situation is
correctly handled by the extends
relationship. Using the extends relationship (as
shown in the
following diagram), we can express that there are two ways to
assign a
seat: assigning a window seat and assigning an aisle seat,
but only one need be
completed in the process of assigning the
passenger a seat.
Back to top
https://www.andrew.cmu.edu/course/90-754/umlucdfaq.html#top 12/14
م1:21 2022/10/10 UML Use Case Diagrams: Tips
Back to top
https://www.andrew.cmu.edu/course/90-754/umlucdfaq.html#top 13/14
م1:21 2022/10/10 UML Use Case Diagrams: Tips
https://www.andrew.cmu.edu/course/90-754/umlucdfaq.html#top 14/14