The diagrams that represent the language for specifying, visualizing, preparing and documenting the requirements into an understandable format are called UML diagrams.
UML stands for Unified Modelling Language.
- It is a language of diagrams.
- It depicts the communication that happens in the diagram.
UML diagram are usually of 9 types. Amongst which 5 are static and 4 are dynamic.
Use case diagram falls under the category of Static UML diagram while Activity diagram falls under the category of Dynamic UML diagram.
Use case Diagram:
- The diagram shows the interaction between the external users with the current system.
- It is high level diagram and is the base for any other design to be prepared.
In short, it represents the end user expectations.
- It depicts how the user is performing the actions using the system.
- Only positive flow is modeled in Use case diagram.
Use case Diagram and its various Elements:
There are various elements in drawing a use case diagram.
- Use cases: These are something that represent the action done by the end user on the system.
These are again classified into 2 types:
Essential Use cases – These are directly linked to the end user
Supporting Use cases – These are indirectly linked to the end user.
NOTE: Every use case has its specific use case specification document which has the details of the Use case that it is describing to.
- Actors: They represent the end users who are performing an action on the system. Basically, they play a major role in using functionality of the system.
These are again classified into 2 types:
Primary Actors – They are the ones who is using the system on behalf of the user or may be just who directly interacts with the system.
Secondary Actors – They are the ones who support the system flow to execute the functionalities.
- Communication: The interaction between the use case and the actors are done using the communication. It is represented using an ‘Association’ symbol.
- Includes: When the essential use cases does not exist without the supporting use cases then the link between them used is Include.
- It is also known as Uses.
- Flow of direction is from essential use case to supporting use case.
In short, it represents the mandatory fields in the application or the system.
- Extends: When the supporting use cases exists even without the supporting use cases then the link between them used is Extends.
- Flow of direction is from supporting use case to essential use case.
In short, it represents the optional fields in the application or the system.
- System Boundary: It is used to represent the entire system.
- Generalization: It is used to represent when the essential use case have one or more supporting use cases, then we use generalization.
Steps to Draw a Use case Diagram:
- Any sort of information should not be disclosed in the diagram.
- Primary and secondary actors should be identified.
- Trying to identify the relationship between the actors and use cases.
- Identifying the essential and the supporting use cases appropriately.
- Making a clear vision on which actor is performing the action specified to particular essential use case.
- The diagram which represents how the system is responding to the user actions.
- It represents the functional flow of the system.
- It represents the sequence of actions that are to be performed by the system when there’s a user action.
Activity Diagram and its various Elements:
- Start/Initial Node: Represents the start node where the flow begins.
- Control Flow: Represents the direction of workflow.
- Final Node: Represents the end of the workflow.
- Action State: Represents the step in the process that is achieved in the workflow.
- Decision Box: Represents which possible path to take based on the condition specified. Basically, it is a choice to be made.
- Event: Represents a trigger attached to a control flow by forcing previous activity to end.
- Guard: Represents a condition attached to a control flow. Based on the condition, the workflow will go along with the control flow.
- NOTE: This is used to represent if and else conditions and represent the conditional flow.
- Connector: Represents multiple inputs and multiple outputs.
- Continuation Node: Represents the continuity for the pages for which the activity is big and has spanning pages.
- Branch & Merge: Represents when there are multiple flows leads to the same activity which leads to the same workflow.
- NOTE: They represent “OR” conditions between action states.
- Fork & Join: Bars are used to represent the parallel activities. Flow can be taken place in any order in parallel activities. Fork represents the point where the activities begin in any order. Join represents the conclusion of the activities of the parallel activities.
- NOTE: They represent “AND” conditions between action states.
- Nested Loop Activity: Represents the series of activities that are taking place internally.
Note: When we open a branch in any context in an activity diagram then it is not mandatory to close with a merge.
But, when we open a fork in any context in an activity diagram then we must close it with a join.