0% found this document useful (0 votes)
22 views49 pages

SE Lab - USE CASE DIAGRAMS

Uploaded by

jaspinder257
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views49 pages

SE Lab - USE CASE DIAGRAMS

Uploaded by

jaspinder257
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

USE CASE DIAGRAMS

RSA documentation:
https://www.ibm.com/docs/en/rational-soft-arch/9.6.1?topic=diagrams-use-case
Tools
● In lab: IBM RSA
● For Practice: Lucidchart, draw.io, diagrams.net etc.
● For RSA
○ Go to File ->New Project Model
○ Select Requirements
○ Empty use case package

Or you can create an empty uml model.


Use Case Diagrams
Visual representation of actors interact with the system under consideration to
accomplish some goal.

Actors: users and/or external systems

Captures FUNCTIONAL requirements of the system from user’s perspective.

Behavioral diagrams
Notations

Actors: represented by stick figure.


What are the actors and what they do?
Actors are someone/something who interacts with the system.
Someone: Users
Something: other software/hardware
They start the interaction with the UseCase and receives an outcome.
Types of Actors
Primary Actors: Who interacts with the system to utilize the functionality of the
system.

Secondary Actors: Who uses the system for maintenance or admin purposes.

Softwares: Interface of the system being developed with other softwares.

Example: in-house E-rickshaw app you are developing will allow registration
through your LMS accounts.

Hardwares: Interface with external hardware systems.


Notations (cont…)

UseCase: represented by oval.

What are the UseCases in your system?

Specific functions that your system do?

High level view of the functionality of the system.

Example: RegisterUser, ShowAttendance, Authenticate


Notations (cont…)

SystemBoundry: represented by rectangle.


Meaning of SystemBoundry:
Defines scope of the system.
Clearly depicts which components are inside the system and which are not?
Helps in focusing only on the essential details without unnecessary details
and external entities.
Notations: Relationships (Arrows)
1. Association ( – )

communication/interaction between a user and an actor.

Symbol: A straight line

Example: Online Banking System

Actor: Customer

Use Case: Transfer Funds

Association: A line connecting the “Customer” actor to the “Transfer Funds”


use case, indicating the customer’s involvement in the funds transfer process.
Notations: Relationships (Arrows)
2. Includes (-----> )

Indicates when a usecase includes the functionality of other use case.

Symbol: A dashed arrow from including use case to included use case with
keyword <<includes>>.

helps in modular and reusable development.

Example: Social Media Posting


Notations: Relationships (Arrows)
2. Extends (----> )

A use case that can be extended by other use case under specific
conditions.

Useful for handling optional and/or exceptional behaviour.

Symbol: A dashed arrow from extended usecase to extending usecase with


keyword <<extends>>.
Notations: Relationships (Arrows)
3. Generalization ( )

Represents “is-a” relationship

Arrow goes from specific case to generic case

Symbol: An arrow with triangle head


Online Shopping System
How to Draw UseCase diagrams?
1. Identify Actors
2. Identify UseCases
3. Connect UseCases
4. Add systemBoundry (use SubSystem in symbols)
5. Define Relationships
Draw UseCase Diagrams for
An online shopping system

A Simple ATM machine

Travel Agency

Vehicle Sale Systems

Attempt to make UseCase diagram for your own project


ATM Machine
Travel Agency
Vehicle Sales System
State Chart Diagrams
Depicts the behaviour of the system.

Based on the concept of finite state machines.

Purpose: To portray various changes in state of the class. Changes are triggered by
Events.

Not the processes or commands causing the changes unlike flowcharts/activity.

Show the different situations a system can be in and how it moves between them.

Dynamic behaviour of classes/objects. States in which those classes/objects can be


and events/time that triggers it.
States and How to identify them?
The current state of an object is determined by the current value of the object’s
attributes and the links that it has with other objects

For example the class StaffMember has an attribute startDate which determines
whether a StaffMember object is in the probationary state.
Example: Different states of object of class - Order
Words on the Line/Arrow
Processed
Trigger : an action

Guard (inside []) : a condition [items available]Processed

Transitional behavior (after /) : a message or variable setting

[items available]Processed/Deliver
Types of Event

• A change event occurs when a condition becomes true


• A call event occurs when an object receives a call to one of its operations
either from another object or from itself
• A signal event occurs when an object receives a signal (an asynchronous
communication)
• An elapsed-time event is caused by the passage of a designated period of
time after a specified event (frequently the entry to the current state)
Action and Activities At work state for
object Employee

Menu Visible
Menu Visible
State for Item selected()/highlightItem()
DropDownMenu entry/displayMenu
do/playSound
Object exit/hideMenu
States of Campaign object
authorized(authorization code
/AssignStaff(), must be a member of Campaign
AssignManager() Commissioned
class

Start authorized(authorizationCode)[contact
signed]/setCampagnActive()

Active
Campaign Completed()/prepareFinalStatement()

paymentReceived(payment)
Completed [paymentDue - payment > zero]
paymentReceived(payment)
[paymentDue - payment < =zero]
Recursive transition models any
payment event that does not
Paid reduce the amount due to zero or
ArchiveCampaign/unAssignSta beyond
ff();unAssignManager
States of Campaign object : Additional Transition
authorized(authorization code
/AssignStaff(), must be a member of Campaign
AssignManager() Commissioned
class

Start authorized(authorizationCode)[contact
signed]/setCampagnActive()

Active
Campaign Completed()/prepareFinalStatement()

paymentReceived(payment)
Completed [paymentDue - payment > zero]
paymentReceived(payment)
paymentReceived(payment)
[paymentDue - payment =zero]
[paymentDue - payment < zero]/generateRefund()

Paid

ArchiveCampaign/unAssignSta
ff();unAssignManager
Nested subStates

ACTIVE

AdvertPreparation
advertsApproved()
extendCampaign() /authorize()
/modify Budget()

confirmSchedule()
RunningAdverts Scheduling

campaignCompleted()
/prepareFinalStatement()
Nested States

● The Active state of Campaign with the detail hidden


● The submachine Running is referenced using the include statement

Active

Include / Running
Hidden
decomposition
indicator icon
ACTIVE
Running
AdvertPreparation
advertsApproved()
extendCampaign() /authorize()
/modify Budget()

confirmSchedule()
RunningAdverts Scheduling

campaignCompleted()
/prepareFinalStatement()

Monitoring
surveyComplete()
Survey

Evaluation
runSurvey()
Concurrent States
A transition to a complex state is equivalent to a simultaneous transition to the
initial states of each concurrent statechart

An initial state must be specified in both nested statecharts in order to avoid


ambiguity about which substate should first be entered in each concurrent region

A transition to the Active state means that the Campaign object simultaneously
enters the Advert Preparation and Survey states
cont…
Once the composite states is entered a transition may occur within either
concurrent region without having any effect on the state in the other concurrent
region

A transition out of the Active state applies to all its substates (no matter how
deeply nested)
Synchronized Concurrent States
Synchronization bar [like fork and join]

Explicitly showing how an event triggering a transition to a state with nested


concurrent states causes specific concurrent substates to be entered
Shows that the composite state is not exited until both concurrent nested
statecharts are exited
Preparing Statecharts: Behavioral Approach
1. Examine all interaction diagrams that involve each class that has heavy messaging.
2. Identify the incoming messages on each interaction diagram that may correspond to
events. Also identify the possible resulting states.
3. Document these events and states on a statechart.
4. Elaborate the statechart as necessary to cater for additional interactions as these
become evident, and add any exceptions.
5. Develop any nested statecharts (unless this has already been done in an earlier
step).
6. Review the statechart to ensure consistency with use cases. In particular, check that
any constraints that are implied by the statechart are appropriate.
7. Iterate steps 4, 5 and 6 until the statechart captures the necessary level of detail.
8. Check the consistency of the statechart with the class diagram, with interaction
diagrams and with any other statecharts and models.
ACTIVE
Running AdvertPreparation
advertsApproved()
extendCampaign() /authorize()
/modify Budget()
confirmSchedule()
RunningAdverts Scheduling

campaignCompleted()
/prepareFinalStatement()

Monitoring surveyComplete()
Survey

Evaluation
runSurvey()
To Do : Previous Year
Draw the State Chart Diagram for the Weather Monitoring System. The monitoring
object responds to different service requests and state transitions triggered by
these requests. The paused monitoring system will starts if it receives a Startup
message. It will remain in waiting state until it receives any of these signals/
messages (Test, Report weather, Clock Signal, Calibrate). A collecting state is
entered when a clock (PTO) signal is received. After collection, it will again move
to waiting state. If reportWeather message is received, the system moves to
summarising state. It will transmit the data before moving to waiting state again. If
calibrate message is received, the system moves to calibrating state. Testing state
requires calibration OK and test message for transmission to trigger
Solution
Sequence Diagrams
● Sequence diagrams demonstrate the behavior of objects in a use case by
describing the objects and the messages they pass.
● Interaction: describes a collection of communications between instances,
including all ways to affect instances, like operation invocation, as well as
creation and destruction of instances
● Kinds

– sequence diagram (temporal focus)

– collaboration diagram (structural focus)


Sequence Diagrams
A sequence diagram is an interaction diagram that emphasizes the time ordering
of messages.

• Sequence diagram shows a set of objects and the messages sent and received
by those objects.

• The objects are typically named or anonymous instances of classes, but may
also represent instances of other things, such as collaborations, components, and
nodes.

• You use sequence diagrams to illustrate the dynamic view of a system.


Interaction Diagrams
Collaboration Diagrams
A collaboration diagram is an interaction diagram that emphasizes the structural
organization of the objects that send and receive messages.

• Collaboration diagram shows a set of objects, links among those objects, and
messages sent and received by those objects.

• The objects are typically named or anonymous instances of classes, but may
also represent instances of other things, such as collaborations, components, and
nodes.

• You use collaboration diagrams to illustrate the dynamic view of a system


Sequence Diagrams
Lifeline;
user1: User
PC: Device

Self Message

Reply
Create and Delete Messages
Sequence Diagrams: Library Management Systems
Collaboration Diagrams: Library Management Systems
Examples from Internet: Hotel Reservation State Transition Diagram
Examples from Internet: Surveillance System
Examples from Internet: Bidding Items
Examples from Internet: A Seminar during registration

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy