Unit 2 SystemAnalysis UML Part 2 1
Unit 2 SystemAnalysis UML Part 2 1
A Use Case diagram simplifies the complex system and is very powerful as a picture is worth a
thousand words!
TYPES
UML diagrams commonly created in visual modeling tools include:
1) Use Case Diagram displays the relationship among actors and use cases.1
2) Class Diagram models class structure and contents using design elements such as classes,
packages and objects. It also displays relationships such as containment, inheritance, associations
and others.
3) Interaction Diagrams
• Sequence Diagram displays the time sequence of the objects participating in the interaction.
This consists of the vertical dimension (time) and horizontal dimension (different objects).1
• Collaboration Diagram displays an interaction organized around the objects and their links to
one another. Numbers are used to show the sequence of messages.1
TYPES
4) State Diagram displays the sequences of states that an object of an interaction
goes through during its life in response to received stimuli, together with its responses
and actions.
5) Activity Diagram displays a special state diagram where most of the states are
action states and most of the transitions are triggered by completion of the actions in
the source states. This diagram focuses on flows driven by internal processing.
TYPES
6) Physical Diagrams
• Component Diagram displays the high level packaged structure of the code itself.
Dependencies among components are shown, including source code components, binary code
components, and executable components. Some components exist at compile time, at link time,
at run times well as at more than one time. 1
• Deployment Diagram displays the configuration of run-time processing elements and the
software components, processes, and objects that live on them. Software component instances
represent run-time manifestations of code units.
USE CASE DIAGRAMS
A use case is a set of scenarios that describing an interaction between a user and a
system.
A use case diagram displays the relationship among actors and use cases. The two
main components of a use case diagram are use cases and actors.
An actor is represents a user or another system that will interact with the system you are modeling.
A use case is an external view of the system that represents some action the user might perform in order to
complete a task.
WHEN TO USE: USE CASES DIAGRAMS
Use cases are used in almost every project.
They are helpful in exposing requirements and planning the project.
During the initial stage of a project most use cases should be defined, but as the
project continues more might become visible.
HOW TO DRAW: USE CASES DIAGRAMS
Use cases are a relatively easy UML diagram to draw, but this is a very simplified
example.
Start by listing a sequence of steps a user might take in order to complete an action. For
example a user placing an order with a sales company might follow these steps.
1. Browse catalog and select items.
2. Call sales representative.
3. Supply shipping information.
4. Supply payment information.
5. Receive conformation number from salesperson.
USE CASES DIAGRAMS
EXAMPLE : ONLINE TRAINING REGISTRATION
Step 1: Draw the System Boundary and name the system
Step 2:
Draw the actors by referring to the
column ‘Allowed actors’ in the ‘List of
System’ section and name them as per
the project standard icon and names
as described in the ‘List of Actors’
section of the document.
The actors ‘New-User’, ‘Registered-
User’, and ‘Employee–Cashier’ are the
primary actors of the system.
The other two support service actors,
i.e. the ‘Bank-Payment-Service’ and
the ‘User-Authentication-Service’ are
the supporting actors.
Step 3:
Draw the use case in the scope of the system by referring to the column ‘Use Case names’ in the ‘List
of System’ section and name the use cases as mentioned in the ‘List of Use Cases‘ section of the
document.
Step 4:
Add the Include and extension use cases for
the in-scope use cases by referring to the
‘List of Use Cases‘ section of the document.
‘Join-a-Course’ includes two Use cases–
‘Course-payment’ and ‘View-Courses’.
Establish the association with a dash-line
starting from the base use case with an
arrow pointing to the included two use
cases.
Depict ‘Register-User’ with its two extension
points with ‘Register-help’ and ‘Location-
Search-help’ and associate it with a dashed
line and an arrow pointing to ‘Register-
User’.
The Note feature can be added as shown in
the diagram to give details.
Step 5:
Establish the link between the actors and
the Use cases. The column ‘Allowed
Actors/Multiplicity number of Actor’ in the
‘List of Use Cases‘ section of the document
gives all the actors to Use case
association.
There can be some actor that is allowed
by the Use case but they do not have any
role in the current system being depicted.
Like the actor ‘Instructor’ that can access
use case ‘View-Courses’ but does not have
a role in the current system being
depicted.
UML Diagram
ACTIVITY DIAGRAM
In UML, the activity diagram is used to demonstrate the flow of control within the
system rather than the implementation. It models the concurrent and sequential
activities.
The activity diagram helps in envisioning the workflow from one activity to another. It
put emphasis on the condition of flow and the order in which it occurs. The flow can
be sequential, branched, or concurrent, and to deal with such kinds of flows, the
activity diagram has come up with a fork, join, etc.
It is also termed as an object-oriented flowchart. It encompasses activities composed
of a set of actions or operations that are applied to model the behavioral diagram.
COMPONENTS OF AN ACTIVITY DIAGRAM
Activities: The categorization of behavior into one or more actions is termed as an
activity.
Activity partition /swimlane: The swimlane is used to cluster all the related activities
in one column or one row. It can be either vertical or horizontal. It used to add
modularity to the activity diagram. It is not necessary to incorporate swimlane in the
activity diagram. But it is used to add more transparency to the activity diagram.
COMPONENTS OF AN ACTIVITY DIAGRAM
Forks: Forks and join nodes generate the concurrent flow inside the activity. A fork
node consists of one inward edge and several outward edges. It is the same as that
of various decision parameters. Whenever a data is received at an inward edge, it
gets copied and split crossways various outward edges. It split a single inward flow
into multiple parallel flows.
COMPONENTS OF AN ACTIVITY DIAGRAM
Join Nodes: Join nodes are the opposite of fork nodes. A Logical AND operation is
performed on all of the inward edges as it synchronizes the flow of input across one
single output (outward) edge.
NOTATION OF AN ACTIVITY DIAGRAM
Activity diagram constitutes following notations:
Initial State: It depicts the initial stage or beginning of
the set of actions.
Final State: It is the stage where all the control flows and
object flows end.
Decision Box: It makes sure that the control flow or
object flow will follow only one path.
Action Box: It represents the set of actions that are to be
performed.
WHY USE ACTIVITY DIAGRAM?
Activity diagrams are used for various purposes and at different stages in the development process.
During the planning stage, you can create an activity diagram to depict workflows and visualize
the sequence of activities in a system.
Meanwhile, at the requirements stage, activity diagrams can be used to present different use
cases for a system.
As for the design phase, an activity diagram can model software elements such as method,
function, and operation.
Other uses of activity diagrams include:
Modeling business processes
Illustrating the dynamic aspects of a system
Defining the logic or rules of a system
Identifying use cases for a system
Simplifying complex workflows
HOW TO DRAW AN ACTIVITY DIAGRAM?
An activity diagram is a flowchart of activities, as it represents the workflow among various
activities.
An activity diagram is an enhancement of the flowchart, which encompasses several unique
skills. Since it incorporates swimlane, branching, parallel flows, join nodes, control nodes, and
forks, it supports exception handling.
Exception handling is shown with the help of -