4. Unified Modeling Language
ü UML is to define a standard way to visualize the
the behavior and structure of a system
ü First introduced in Jan 1997
UML diagrams types:
ü Structural Diagrams – Capture the static structure of
the system using objects, attributes, operations and
relationships
ü Behavior Diagrams – Capture the dynamic behavior
of the system by showing collaborations among
objects and changes to the internal states of objects
Diagram
UML - Definition
5. Diagram
UML Diagram Types
% of methods using specific UML diagram type
Ref: https://www.researchgate.net/publication/320709806_Topological_UML_Modeling_An_Improved_Approach_for_Domain_Modeling_and_Software_Development
14. Activity Diagram
Definition
When to Use Activity Diagram
ü Model software elements: methods, operations and functions
ü Present concurrent activities in the system
ü Show the constraints, conditions and logic behind algorithms
ü Model in detail complex activities in a high level
Types:
ü Swimlane Activity Diagram – group activities performed by the same
actor in a single thread
ü Non-Swimlane Activity Diagram – representing the flow of interaction
from one activity to another
Note: Swimlane Activity Diagram = Business Process Model and Notation (BPMN)
15. Activity Diagram
Notations / Symbols
Symbols:
ü Start: Beginning of a set of actions or activities
ü End / Terminator: Stop all flows in an activity (or action)
ü Activity Flow: Shows the sequence of execution
ü Action / Activity: A task to be performed
ü Fork: Split behavior into a set of parallel or concurrent flows
ü Join: Bring back together a set of parallel or concurrent flows
ü Decision: Represent a test condition to ensure that the control
flow or object flow only goes down one path
ü Swimlane / Partition: Group activities performed by the same
actor on an activity diagram or to group activities in a single thread
16. Activity Diagram
Non-Swimlane Diagram
How to draw Non-Swimlane Diagram:
ü Step 1: Finding all system Activities
ü Step 2: Identifying key scenarios of system use cases
ü Step 3: Combining the scenarios to produce comprehensive
workflows described using activity diagrams
ü Step 4: Where significant object behavior is triggered by a
workflow, adding object flows to the diagrams
ü Step 5: Refining complicated high level activities similarly,
nested activity diagrams
17. Activity Diagram
Swimlane Diagram
How to draw Swimlane Diagram:
ü Step 1: Figure out the action steps from the use case. Identify:
§ Various activities
§ Your business process actions
ü Step 2: Identify the actors who are involved
§ Figure out who the actors are
§ Define each action they are responsible for
ü Step 3: Find a flow among the activities
§ Figure out in which order the actions are processed
§ Mark down the conditions that have to be met
§ Which actions occur at the same time?
ü Step 4: Add swimlanes
§ Assign each action to a swimlane and group
§ Connect the activities by flow in the diagram
18. Activity Diagram
Example 1 – Student Enrollment
Student enrollment in a university:
ü An applicant wants to enroll in the university
ü The applicant hands a filled out copy of Enrollment Form
ü The registrar inspects the forms
ü The registrar determines that the forms have been filled out properly
ü The registrar informs student to attend in university overview presentation
ü The registrar helps the student to enroll in seminars
ü The registrar asks the student to pay for the initial tuition
21. Client Meeting Process:
ü Sales person wants to make an appointment with Consultant
ü Sale person needs to call Consultant to setup a meeting
ü A meeting can be at the office (onsite) or remote meeting (offside)
ü Onsite meeting will be held in a meeting room of Sale person’s company
ü Offsite meeting required a laptop available from the Consultant
ü A follow-up email will be provided by the Sales person after the appointment
ü The Consultant reviews and provides a proposal if the business needs improvements
Activity Diagram
Example 2 – Client Meeting Process
26. Use Case Diagram
Definition
Use case diagram
ü Uses a set of specialized symbols and connectors
ü Summarizes details of your system’s users (actors) and their
interactions with the system
ü Describe the ‘what’ of a system and no ‘how’
Present:
ü Scenarios in which your system or application interacts with people,
organizations, or external systems
ü Goals that your system or application helps those entities (known as
actors) achieve
ü Modeling the basic flow of events in a use case
ü The scope of your system
27. Use Case Diagram
Notations / Symbols
1. Actor
ü Stick figures that represent the people actually employing
the use cases
ü An actor can be: Human, System/ Software, Hardware,
Timer/ Clock
ü Note: Actor represents a role that a user can play but not a
specific user.
§ For example: in a hospital information system (HIS):
§ Actors: doctor and patient as actors
§ Dr. John, Mrs. Brown not actors
28. Use Case Diagram
Notations / Symbols
2. Use Case
ü Horizontally shaped ovals that represent the different uses
that a user might have
ü Represents a user goal that can be achieved
ü You can create a sub-sequence diagram under a use case
29. Use Case Diagram
Notations / Symbols
3. Relationship
ü Association: A line between actors and use cases represents
which actors are associated with which use cases
ü Include: defines that a use case contains the behavior
defined in another use case
ü Extend: specifies that the behavior of a use case may be
extended by the behavior of another use case
ü Generalization: represent inheritance relationship between
model elements of same type
Association Include Extend Generalization
30. Use Case Diagram
Notations / Symbols
4. System
ü The scope of a system can be represented by a
system (shape), or sometimes known as a system
boundary
ü The use cases of the system are placed inside the
system shape
ü The actor who interact with the system are put
outside the system.
ü The use cases in the system make up the total
requirements of the system
32. Use Case Diagram
Homework
Create use case diagrams
ü Create below use case diagrams
ü Tool: https://app.diagrams.net/
Exercise #1 Exercise #2
33. What use cases include?
ü Who is using the system
ü What the user wants to do
ü The user's goal
ü The steps the user takes to accomplish a particular task
What use cases Do NOT include?
ü Implementation-specific language
ü Details about the user interfaces or screens
Use Case Diagram
How to create a use case
34. Steps to develop a Use Case Diagram:
ü Step 1: Identify who is going to be using the system
ü Step 2: Pick one of those users
ü Step 3: Define what that user wants to do on the system. Each thing the use does on the site becomes a use case
ü Step 4: For each use case, decide the normal events that user is using
ü Step 5: Describe the basic description for the use case in terms of what the user does and what the system does
ü Step 6: Consider alternate events and add those to "extend" the use case
ü Step 7: Look for commonalities among the use cases. Extract these and note them as common course use cases
ü Step 8: Repeat the steps 2 through 7 for all other users
Use Case Diagram
How to create a use case
43. 3. Homework:
ü Create 2 use case diagrams using draw.io tool
ü Questions?
Diagrams
Review
1. Activity Diagram
ü Differences between Swimlane vs Non-Swimlane Diagram?
ü Symbols of activity diagram?
2. Use Case Diagram
ü What can be actors of a use case diagram?
ü What’s wrong from the below use case diagram?