Understanding UML and Use Case Diagrams in Software Development
Understanding UML and Use Case Diagrams
The Problem and Use Cases
The problem can be defined as the difference between things as perceived and things as they are. A use case is a description of a set of actions executed by a system to produce an observable result of value to an actor. Use cases are determined by observing and mentioning, actor by actor, interaction sequences, and scenarios, from the standpoint of the user.
Use Case Diagrams
A Use Case Diagram is a technique for capturing information regarding the services that a system provides to its environment. It allows defining the limits of the system and the relationships between the system and the environment.
Use cases are descriptions of the functionality of the system, independent of implementation. They are comparable to Data Flow Diagrams in the Structured Approach.
Actors and Modeling
Actors are external entities that interact with the system to achieve a goal. They represent a coherent set of roles.
Modeling is the backbone of quality software development. It helps to:
- Communicate with others to explain the behavior of the system.
- Understand the system better ourselves.
Unified Modeling Language (UML)
UML is a standard language used to write the plans for software. It leverages the object-oriented paradigm to create models in a more logical and easier way. UML can be used for visualizing, specifying, constructing, and documenting all the artifacts that make up a large amount of system software.
UML Building Blocks: Elements, Relationships, and Diagrams
Structural Elements: Mostly static parts of a model.
Classes: Group object attributes and similar elements.
Interface: A collection of operations that specify a service or component class. It does not define the implementation of operations.
Use Case: Description of a sequence of actions. Describes the interaction between actors and the system. It is the description of a set of actions a system performs that produces a certain result of interest to a particular actor.
Elements of Behavior – Interactions: Represent the behavior of a set of messages exchanged between a set of objects within a particular context to achieve a specific purpose.
State Machine: Specifies the sequence of states through which an object passes.
Packages – Grouping Items: Allows you to organize items into groups. All items seen so far can be grouped into packages.
Notes – Annotation Element: Help explain the model. “It’s a symbol to show restrictions and comments next to an item or set of elements.” These are comments that can be applied to describe, classify, and comment on any element of a model.
Relationships – Unit: A change in B may affect A.
Association: Two objects are connected.
Generalization: A is a child of B (a kind of).
Realization: B specifies a contract that A guarantees it will comply with.
Diagrams
A diagram is plotted as a sighting of a part of the system, providing different perspectives and different levels of detail to facilitate system comprehension.
Use Case Diagram: Shows a set of use cases and actors and their relationships.
Class Diagram: Shows a set of interfaces and classes, as well as their relationships and collaborations.
Object Diagram: Represents snapshots of instances of the elements found in the Class Diagram.
Sequence Diagram: Highlights the temporal ordering of messages.
Collaboration Diagram: Highlights the structural organization of objects that send and receive messages.
State Diagram: Highlights the state transition and event-driven behavior of an object.
Activity Diagram: Emphasizes the control flow between objects.
Component Diagram: Shows the organization and dependencies among a set of components.
Deployment Diagram: Shows the configuration of processors in execution time.
General View of UML
UML combines rules that establish restrictions on the blocks.
Name: Used to call the elements.
Scope: The context given to the name.
Visibility: How you can see and use that name.
Integrity: How the elements relate to each other.
Execution: What it means to execute or simulate a dynamic model.
Problem Domain
The problem domain is a plot of the real world we want to model. To study the problem domain, models exist, such as:
- Use Case Diagram
- Abstract Classes Diagram
- Activity Diagram
- Basic Sequence Diagram