This is one of the static diagrams of UML diagrams, which consider as industry standard language for specifying, visualizing and documenting software systems. This diagram identifies the interaction between the system and their actors. Use cases are specifying that the expected behavior and not exact method of making it happen. Use cases once specified can be denoted both visual and textual representation. A key concept of use case modeling is that it helps us design a system from the end user’s perspective. It’s one of the effective techniques for communicating system behavior in the user’s terms by specifying all externally visible system behavior.
A use case diagram does not go to a lot of detail for example, do not expect it to model the order in which steps are performed. Instead, a proper use case diagram outline of a high-level overview of the association between use cases, actors.
Purpose of Use Case Diagram:
Use case diagrams are typically developed in the initial stage of development and people often apply use case modeling for the below purposes:
- Specify the context of the system
- Capture the requirements of a system
- Validate a system’s architecture
- Drive implementation and create test cases
- Developed by analysts together with domain experts
Components of the use case:
- Actors
- System
- Use cases
Use case Relationships:
- Extends relationship
- Include relationship
- Generalization
- Association
Guidelines to draw an effective use case diagram:
- The name of a use case is very important. The name should be chosen in such a way so that it can identify the functionalities performed.
- Give a suitable name for actors.
- Don’t try to include all the types of relationships, as the main purpose of this diagram is to identify the requirements.
- Use running notes whenever required to clarify some important points.
Use case diagrams are illustrate and define the context and requirements of either an entire system or the important parts of the system. Either you can model the complex system with a single use-case diagram or create many Use case diagrams to model the components of the system. You can typically develop use case diagrams in the initial phases of a project and try to refer them throughout the development phases.
Here iam providing use case diagram for online agriculture store for better understanding:
Activity Diagram:
We use Activity Diagrams to illustrate the flow of control in a system and refer to the steps involved in the execution of a use case. We model sequential and synchronous activities using the activity diagrams. This diagram is a flowchart to represent the flow from one activity to another.
The activity could be described as an operation of a system. The control flow is drawn from one operation to another. This flow can be sequential, branched or synchronous. These diagrams deal with all type of flow control by using different components such as fork, join, merge.
Purpose of Activity Diagrams:
The basic purposes of activity diagrams are much related to other 4 diagrams. It captures the dynamic behavior of the system. Other 4 diagrams are used to visualize the message flow from one object to another object but, this diagram is used to show message flow from one activity to another activity. These diagrams are not only used for visualizing the dynamic nature, but activity diagrams are also used to build the executable system by using forward and backward engineering techniques. The only thing missed in the activity diagram is the message part.
How to Draw an activity diagram:
- Identify the initial state and the final states.
- Identify the intermediate activities needed to reach the final state from he initial state.
- List out the conditions or constraints which cause the system to change control flow.
- Draw the diagram with appropriate symbols.
Where to Use Activity Diagrams:
This activity diagram also used as similar to other four UML diagrams. The certain purpose is to model the command flow from one activity to another activity. And this diagram is suitable for modeling the activity flow of the system. An application can have number of systems. Activity diagram also captures these systems and describes the flow from one to another. This specific usage is not available for other diagrams. These systems would be database, external queues and also other systems.
Activity diagrams include the following elements:
- Initial node or start node
- Activity
- Control flow
- Final node or end node
- Stop node
- Decision box
- Guard condition
- Event
- Connector
- Continuation node
- Branch
- And Merger
- Fork and join
- Nested loop activity
Activity diagram can be used for these:
- Modeling work flow by using activities.
- Modeling business requirements.
- High level understanding of the system’s functionalities.
- Will Investigate the business requirements at a later stage.