Use Case Diagrams (UCD) is a high level diagram and it is drawn from End Users perspective. It can be used to describe the functionality of the System and represents only the positive flow.
UCD’s have four major component: The Actors, The System , The Use Cases and The Lines .
Actors: They interact with the System to perform the task. It is always represented by Noun. Actors should be placed on outside the system boundary .Actors are of two types:
- Primary Actors Secondary Actors
Primary Actors initiates the system to work and System depends on the Secondary Actors for information.
Primary Actors should be placed on the right side of the System boundary and Secondary Actors should be placed on the right side of the boundary.
Use Cases : This is used for the different business functions. It comes inside the System Boundary and is represented by eclipse.
System : It represents the system as a whole and all the use cases drawn inside the System. It is shown by Rectangular Box.
Lines : Lines are used for relationships between the elements.
Generally 3 types of relationships used in Use Case Diagram:
- It is a kind of relationship.
- Parent class doesn’t exist without none of its child class.
- Direction of arrow is based on dependency.
Generalization is of two types:
1.Actor Generalization: It is a kind of relationship between the actor.
Example: If we generalized Customer into Customer and VIP Customer then it is the example of Actor Generalization.
2.Use Case Generalization: It is a kind of relationship between the usecase.
Example: We can do the Payment either by Cash or by Card or by Coupons . Here Parent class doesn’t exist without its Child class means we have to opt one mode to do the payment .
- It is a compulsory relationship between the elements.
- Parent class is not complete without its child class.
Example: To transfer Cash it is mandatory to check the availabity of balance in account. It is the mandatory relationship between Transfer Cash and Check balance in Account.
- It is an optional relationship between the elements.
- Parent class exist without child class.
Example: To Withdraw cash from ATM it depends upon the customer to take print out of receipt or not. So we can say that it is optional relationship between Withdraw Cash from ATM and Print Receipt.