Thursday, August 6, 2009

Drawing a Use Case Diagram

Use case diagrams are a way to visualize a System... in other words use cases tell us what the system should do.

Two main goals of a use case diagram are:

a. Visualizing the functional requirements of a system.
b. Describing the interaction between various actors and the system.

Major components of a use case are:











An Actor is someone who intends to achive some goal by using the System.
Example: A customer is an actor for an ATM system.

A Use Case is a process taking place in the system.
Example: Withdrawing cash is a use case for the ATM system.

An Association shows a relation between an actor and a use case. In most cases this relationship means that the actor will initiate the associated use case.
Example: A customer withdraws money.

Generalization shows a parent to child relationship where each child has all the properties of the parent and some unique properties of its own. Generalization can exist between use cases as well as Actors.
Example: A Parent use case Transaction and have child use cases as withdraw funds, transfer funds, Add funds, etc.

"Extends" Dependency depicts a use case which may, optionally, be initiated by another use case.
Example: It may be an option for a customer, who is withdrawing money, to print a receipt.

"Include" Dependency depicts a use case, whose initiation is a must, in order to initiate another use case.
Example: For a customer to withdraw money, his ATM pin code has to be validated.

Here is an example of a Use Case model of an ATM system.