Behavioural UML Diagrams
Behavioural UML Diagrams
Behavioral Diagrams
Mike Erickson
@mgerickson
Introduction
Behavioral Diagrams
Use Case Diagram
Sequence Diagram
State Diagram
Activity Diagram
Behavioral Diagrams
Behavioral Diagrams
Interactions
Functionality
Verbs and Actions
Use Case Diagram
User Tasks
System Interactions Pay Bill
Skip
Scheduled
Payment
Manage
Scheduled
Payment
Terminate
Scheduled
Payment
Common Users of Use Case Diagrams
Operations
Quality Assurance Developer
Actors
People
Roles
Generalization Account Holder Customer
Systems
Individual Commercial
Payment
Processing
Service
Use Cases
Simple name
Authenticate
Pay Bill <<include>>
User Tasks User
System Interactions
Factor out common processes <<extend>>
(<<include>>)
Identify optional additions Schedule
Recurring
(<<extend>> Payment
Generalize Process
Loan
Request
Fixed Variable
Interest Interest
Loan Loan
Scenarios
Scenario
Steps in process
Branches
Extensions
Exceptions
Use Case vs. Use Case Diagram
Pre-Conditions
Post-Conditions
May Relate to User Stories
Basic Use Case Diagram
Pay Bill
Customer <<include>>
Payment
<<extend>> Processing
Service
Authenticate
Schedule User
Recurring
Payment
Skip
Scheduled
Payment
Manage
Scheduled
Payment
Terminate
Scheduled
Payment
Sequence Diagram
WebClient AccountSvc Account Payee Scheduler Processor
Object Interaction SchedulePayment()
Verify()
Focus on time/order
opt
ValidAccount GetDetails()
GetPayments
opt
FirstPayment
SendZeroValueTestPayment()
ScheduleFuturePayment()
Common Users of Sequence Diagrams
Operations
Quality Assurance Developer
Classes
Return Message()
Self Message Return
Asynchronous Message()
SelfMessage()
Return
AsynchronousMessage()
Structured Control
Optional Message()
Conditional Return
[else] opt
loop
alt
par
Parallel PremiumCustomer
for each Payee Message()
SelfMessage()
Return
StandardCustomer
Message()
Return
AsynchronousMessage()
Basic Sequence Diagram
opt
ValidAccount GetDetails()
GetPayments
opt
FirstPayment
SendZeroValueTestPayment()
ScheduleFuturePayment()
State Diagram
object Scheduled
Reschedule
Faulted
Cancel
Cancelled
Reactive objects
Processing
entry / logPaymentAttempt()
do / waitForConfirmation()
exit / logConfirmation
Completed
entry / notifyCustomer()
Common Users of State Diagrams
Operations
Quality Assurance Developer
States
Basic Scheduled
Internal Behavior
Special
Processing
Initial
entry / logPaymentAttempt()
Final do / waitForConfirmation()
exit / logConfirmation
Transitions
Basic
Transition
Reschedule
Event Scheduled Faulted
Processing
entry / logPaymentAttempt()
do / waitForConfirmation()
exit / logConfirmation
Composite State
Idle
Reschedule
Scheduled Faulted
Cancelled
Processing
entry / logPaymentAttempt()
do / waitForConfirmation()
exit / logConfirmation
Basic State Diagram
Idle
Reschedule Cancel
Scheduled Faulted Cancelled
Processing
entry / logPaymentAttempt()
do / waitForConfirmation()
exit / logConfirmation
Completed
entry / notifyCustomer()
Activity Diagram
Has Account
Verify
Documentation
Fund Loan
Common Users of Activity Diagrams
Operations
Quality Assurance Developer
Actions and Activities
Actions
Single Step
Activity Submit
Application
Multiple Step
Decomposed in own diagram
Special
Initiation
Completion
Flow Control
Decision / Branch
Fork and Join No Account
Has Account
Has Account
Verify
Documentation
Fund Loan
Summary
Behavioral Modeling
System Logic
Algorithms
Flows
Use Case Diagrams
Functionality / Features
Sequence Diagrams
Time ordered messages between objects
State Diagrams
Transitions between states for an object
Activity Diagrams
Enhanced flowchart