UML Use Case Diagram

 

UML Use Case Diagram

Download Visual Case Free for 30 Days

Visual Case Tool - UML Tutorial

2. The Use Case Diagram

In many design processes, the use case diagram is the first that designers will work with when starting a project.  This diagram allows for the specification of high level user goals that the system must carry out.  These goals are not necessarily tasks or actions, but can be more general required functionality of the system.

Use Case

More formally, a use case is made up of a set of scenarios.  Each scenario is a sequence of steps that encompass an interaction between a user and a system.  The use case brings scenarios together that accomplish a specific goal of the user.

A use case can be specified by textually describing the steps required and any alternative actions at each step.  For example, the use case for searching a web for a keyword might be shown as:

1. Customer enters the keyword
2. Customer clicks the search button
3. The search is executed
4. The results are shown

Alternative: Search Failed
If the search fails at 3, then the user is redirected back to the search screen at step 1

In Visual Case, you can specify the steps of a use case in its description field.  Simply right-click on a use case and select properties.  You can then run a report and print or export the results to html or ascii text.  Together, the report and the diagrams will include all of the details of the use case - their specific scenarios and the actors that carry them out.

Actor

The use case diagram allows a designer to graphically show these use cases and the actors that use them.  An actor is a role that a user plays in the system.  It is important to distinguish between a user and an actor (better thought of as a role).  A user of the system may play several different roles through the course of his, her or its job (since an actor may be another system).  Examples of actors are salesperson, manager, support person, and web store system.  It is possible that the same person may be a sales person and also provide support.  When creating a use case model, we are not concerned with the individuals, only the roles that they play.

Associations

On a use case diagram, associations are drawn between actors and use cases to show that an actor carries out a use case.  A use case can be carried out by many actors and an actor may carry out many use cases.

In the above diagram, the actors are shown as the green stick figure shapes on the left, the use cases are the blue ellipses, and the associations between them are represented by the connecting lines.  The developer and the stakeholder both are responsible for specifying the system roles, but only the developer creates the model.

Includes

Use cases can also be related to each other with three different links.  The diagram below shows the use of the includes link.  Both invoice purchase and online purchase include the scenarios defined by purchase valuation.  In general, the includes link is to avoid repetition of scenarios in multiple use cases.

Generalization

When a use case describes a variation on another use case, use a generalization link.  In the example below, the use case limit exceeded describes a situation in which the usual scenario of online purchase is not performed.  Use cases that generalize another use case should only specify an alternative, even exceptional, scenario to the use case being generalized.  The overall goal of the use cases should be the same.

Extends

In some instances you want to describe a variation on behaviour in a more controlled form.  In such instances you can define extension points in the extended use case.  In the example below, search by name is said to extend search at the name extension point.  The extends link is more controlled than the generalization link in that functionality can only be added at the extension points.

Putting it all Together

When starting a use case model, it is very important to keep it simple.  Often it is easiest to first determine the actors of the system, and then flush out the use cases that they perform.  Your use case diagrams can be as simple or complex as you wish, however simpler, less cluttered diagrams are easier to understand, and are often more powerful in capturing the tasks of the system.

In Visual Case, you can explode a use case into a new use case diagram.  For example, the use case online purchase may require further specification as you move into the design.  You can create a sub-diagram within any use case to help clarify and understand the tasks involved. 

Remember that a use case represents a goal of a user, not an atomic programming operation.  Your use case design should be simple and help to clarify the user's goals and expectations for the system.


Page 1: Introduction
Page 2: Use Case Diagrams
Page 3: Class Diagrams
Page 4: Interaction Diagrams - Sequence & Collaboration
Page 5: Activity & State Diagrams
Page 6: Implementation Diagrams - Component & Deployment
Page 7: Summary & Further Reading


Visual CaseTM  is a trademark or registered trademark of Artiso Corp. Canada.

Microsoft, Windows, SQL Server, VB, Visual Basic and Access are registered trademarks of Microsoft Corporation.
Oracle is a registered trademark of Oracle Corporation.
Unified Modeling Language and UML are trademarks of Object Management Group Inc. in the U.S. and other countries.
Other brands and their products are trademarks or registered trademarks of their respective holders and should be noted as such.

This site is best viewed at a resolution of 800 by 600 using Internet Explorer 5.

Visual Case Tutorials

 Home
Tutorials
 Flow Charting

 Data Flow Diagramming

 UML Tutorial

 Database Design Tutorial Database Engineering Tutorial

 Supported Databases

 Contact Us


UML Tutorial

Introduction
Use Case Diagrams
Class Diagrams
Interaction Diagrams
Activity & State Diagrams
Implementation Diagrams
Summary