UML Activity and Sequence Diagrams David Millard

Slides:



Advertisements
Similar presentations
© 2005 by Prentice Hall Appendix 3 Object-Oriented Analysis and Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
Advertisements

1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 6 State Machine and Activity Diagrams (Based on Stevens and Pooley (2006,
Activity Diagrams in UML. Definition Activity diagrams represent the dynamics of the system. They are flow charts that are used to show the workflow of.
UML (Sequence Diagrams, Collaboration and State Chart Diagrams) Presentation By - SANDEEP REDDY CHEEDEPUDI (Student No: ) - VISHNU CHANDRADAS (Student.
Ana M. Fernández  A UML diagram that depicts: ◦ interactions between objects. ◦ how the business currently works by showing how various.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
7M701 1 Activity Diagram. 7M701 2 Example 7M701 3 Activity Diagram: what is it? Describes activities and flows of data or decisions between activities.
Software Engineering COMP 201
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
Introduction to UML Part 2 Behavioral Modeling. Sequence (event) diagram Describes object interaction Typically captures behavior of a single use case.
Slide 10B.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Essentials of interaction diagrams Lecture 23 & 24.
7M822 UML Activity Diagrams 6 October 2008.
03/12/2001 © Bennett, McRobb and Farmer Activity Diagrams Based on Chapter 5 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and.
© Copyright Eliyahu Brutman Programming Techniques Course.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
SE-565 Software System Requirements More UML Diagrams.
Sequence diagram example T120B029P pavasaris.
1COM6030 Systems Analysis and Design © University of Sheffield 2005 COM 6030 Software Analysis and Design Lecture 6 - Use cases and activity diagrams Dr.
Unified Modeling Language
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
CS3773 Software Engineering
BPMN By Hosein Bitaraf Software Engineering. Business Process Model and Notation (BPMN) is a graphical representation for specifying business processes.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Slide 16B.51 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 21. Review ANALYSIS PHASE (OBJECT ORIENTED DESIGN) Functional Modeling – Use case Diagram Description.
1 SAD2 - UML 2 nd Lecture Sequence Diagram and other dynamic views Lecturer: Dr Dimitrios Makris
Systems Analysis and Design in a Changing World, 6th Edition
Requirements Artifacts Precursor to A & D. Objectives: Requirements Overview  Understand the basic Requirements concepts and how they affect Analysis.
1 Sequence Diagrams (Based on Stevens and Pooley (2006, Chapters 9, 10) and Fowler (2004, Chapter 4)) David Meredith Aalborg University.
1 Interaction diagrams and activity diagrams Speaker: 陳 奕 全 Real-time and Embedded System Lab 15 August 2002.
1 Devon M. Simmonds University of North Carolina, Wilmington CSC450 Software Engineering WorkFlow Modeling with Activity Diagrams.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
Faculty of Applied Engineering and Urban Planning Software Engineering Department Software Engineering Lab Use Cases Faculty of Information system Technology.
9-1 © Prentice Hall, 2007 Chapter 9: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
The Unified Modeling Language Part II Omar Meqdadi SE 2730 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Interaction Diagrams Interaction Diagrams allow the designer to show how groups of objects collaborate in some behavior. –Interaction Diagrams will show.
Use Case Driven Analysis Requirements Use Case Use Case Description System Sequence Diagram Chapter 5.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 5 INTRODUCTION TO SYSTEMS ANALYSIS AND DESIGN: AN AGILE, ITERATIVE APPROACH CHAPTER.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
UML Activity Diagrams.
Chapter 3: Introducing the UML
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
Software Engineering: Models David Millard
UML Class Diagrams David Millard
Requirements capture: Using UML Use Cases David Millard and Yvonne Howard {dem,
Sequence diagrams Lecture 5. Main terms  Interaction  Life line  Activation  Executable behavior and derived behavior  Messages  Trajectory  Frame.
OCR A Level F453: High level languages Programming techniques a. identify a variety of programming paradigms (low-level, object- oriented,
Systems Analysis and Design in a Changing World, Fourth Edition
Business Process and Functional Modeling
Analysis Classes Unit 5.
Unified Modeling Language
Business System Development
UML Activity Diagrams.
System Sequence Diagrams
Week 12: Activity & Sequence Diagrams
Interaction Diagrams A Lot of UML!
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
Appendix 3 Object-Oriented Analysis and Design
UML & Together 2006 tutorial
Presentation transcript:

UML Activity and Sequence Diagrams David Millard

Overview The Software Engineering Big Picture UML Activity Models ▫What are they? ▫How do you create them? ▫When do you use them? UML Sequence Models ▫What are they? ▫How do you create them? ▫When do you use them?

Software Engineering: Big Picture Requirements Gathering Surveys User studies Focus groups SSM Specification UML Use Cases Scenarios Storyboards Design UML Class Diagrams Activity Diagrams Sequence Diagrams Etc… Implementation Software code APIs Document formats Testing Unit Tests Black Box Tests Etc… Deployment Configuration Bug Tracking User Support This is rarely a straightforward progression – in reality there are lots of iterations and points of feedback

Software Engineering: Big Picture Requirements Gathering Surveys User studies Focus groups SSM Specification UML Use Cases Scenarios Storyboards Design UML Class Diagrams Activity Diagrams Sequence Diagrams Etc… Implementation Software code APIs Document formats Testing Unit Tests Black Box Tests Etc… Deployment Configuration Bug Tracking User Support This is rarely a straightforward progression – in reality there are lots of iterations and points of feedback Designing a solution Specifying Behaviour and Interaction

Capturing Behaviour: A Problem With a partner draw a diagram to capture the following process (as if you were graphically describing it): “You’re dozing in bed, waiting for your alarm. When it goes off you get up, get dressed and go downstairs. You make some breakfast and eat it while reading the morning paper. When you finish you leave the house.”

Look at Your Diagram What were the features of your diagram? ▫Actions or Events ▫…

Look at Your Diagram What were the features of your diagram? ▫Actions or Events ▫Sequence ▫Parallel ▫A Start and Stop ▫Decisions ▫Logical Partitions?

UML Activity Diagrams UML Equivalent of a FlowChart ▫Provides a high level view of what’s going on inside a Use Case ▫(Is a variation of a UML State Diagram)

UML Activity Diagrams Get Up Get Dressed StartTransitionStop Is based on: ▫Activities ▫Linked with Transitions ▫With one Start and one Stop Activity

UML Activity Diagrams Doze Alarm gone off? Get Up [Yes] [No] Decisions points (branches) are written as diamonds ▫A Branch has an optional description ▫Transitions out of a branch are labeled (guard conditions) Branch Guard Conditions

UML Activity Diagrams Make Breakfast Leave House Eat Breakfast Read Paper Bars (Forks and Joins) ▫Used to show that things happen in parallel ▫Or to bring together several transitions ForkJoin

Putting it All Together Make Breakfast Leave House Eat Breakfast Read Paper Doze Alarm gone off? Get Dressed [Yes] [No] Go Downstairs Get Up

Adding Swimlanes Make Breakfast Leave House Eat Breakfast Read Paper Doze Alarm gone off? [Yes] [No] Go Downstairs Upstairs Downstairs Get Dressed Get Up

Adding Swimlanes Swimlanes partition a diagram ▫Used to show different logical areas Diagrams can often be partitioned in different ways ▫According to a Phase ▫According to the Actor ▫According to Department There is no right way ▫Partition in whatever is the most useful way

When to use Activity Diagrams? When analysing a use case ▫What actions are there and when do they happen? ▫This is sometimes called the Flow of Control Useful for communicating order and dependency But they do not show Interactions, Data or State ▫Other UML diagrams for this!

Break…

Consider another problem… Academic staff can set a coursework or duplicate an existing coursework using an assessment system. The system alerts students to new assignments, and allows them to submit their work. Some students use a proofreader to check their work before submission. Submitted coursework is then sent back to the academic to be assessed. Feedback and marks are submitted to the system, which passes them on to the student.

Consider another problem… Academic staff can set a coursework or duplicate an existing coursework using an assessment system. The system alerts students to new assignments, and allows them to submit their work. Some students use a proofreader to check their work before submission. Submitted coursework is then sent back to the academic to be assessed. Feedback and marks are submitted to the system, which passes them on to the student. What might an activity diagram of this look like?

Consider another problem… Academic staff can set a coursework or duplicate an existing coursework using an assessment system. The system alerts students to new assignments, and allows them to submit their work. Some students use a proofreader to check their work before submission. Submitted coursework is then sent back to the academic to be assessed. Feedback and marks are submitted to the system, which passes them on to the student. What might an activity diagram of this look like? Is it good at answering questions like: ▫What is the student’s role? ▫For how long is the proofreader needed? ▫Who talks with who?

Consider another problem… We could use an Activity Diagram to record the process But what if we are more interested in the interactions? In this case a Sequence Diagram is more appropriate Academic staff can set a coursework or duplicate an existing coursework using an assessment system. The system alerts students to new assignments, and allows them to submit their work. Some students use a proofreader to check their work before submission. Submitted coursework is then sent back to the academic to be assessed. Feedback and marks are submitted to the system, which passes them on to the student.

Lifelines A Lifeline represents a role or object instance in the sequence Academic staff can set a coursework or duplicate an existing coursework using an assessment system. The system alerts students to new assignments, and allows them to submit their work. Some students use a proofreader to check their work before submission. Submitted coursework is then sent back to the academic to be assessed. Feedback and marks are submitted to the system, which passes them on to the student. tutor : AcademicStaff

assesse : Student assesse : Student ecshandin : AssessmentSystem tutor : AcademicStaff reader: ProofReader reader: ProofReader

Messages and Return Values A message can be sent between lifelines, and optionally a return value can be sent back Academic staff can set a coursework or duplicate an existing coursework using an assessment system. The system alerts students to new assignments, and allows them to submit their work. Some students use a proofreader to check their work before submission. Submitted coursework is then sent back to the academic to be assessed. Feedback and marks are submitted to the system, which passes them on to the student. ecshandin : AssessmentSystem tutor : AcademicStaff setNewCswk() submittedCswk

assesse : Student assesse : Student ecshandin : AssessmentSystem tutor : AcademicStaff reader: ProofReader reader: ProofReader

assesse : Student assesse : Student ecshandin : AssessmentSystem tutor : AcademicStaff reader: ProofReader reader: ProofReader setNewCswk() alertStudentToCswk() submittedCswk sendFeedback() sendMarks() submittedCswk

Alternatives A UML frame called ‘alt’ can be used to show two or more mutually exclusive message sequences Academic staff can set a coursework or duplicate an existing coursework using an assessment system. The system alerts students to new assignments, and allows them to submit their work. Some students use a proofreader to check their work before submission. Submitted coursework is then sent back to the academic to be assessed. Feedback and marks are submitted to the system, which passes them on to the student. ecshandin : AssessmentSystem tutor : AcademicStaff setNewCswk() duplicateCswk() [else] [existingCswk = true] alt

assesse : Student assesse : Student ecshandin : AssessmentSystem tutor : AcademicStaff reader: ProofReader reader: ProofReader setNewCswk() alertStudentToCswk() submittedCswk sendFeedback() sendMarks() submittedCswk

assesse : Student assesse : Student ecshandin : AssessmentSystem tutor : AcademicStaff reader: ProofReader reader: ProofReader setNewCswk() alertStudentToCswk() submittedCswk sendFeedback() sendMarks() duplicateCswk() [else] [existingCswk = true] alt

[proof = true] Optional A UML frame called ‘opt’ can be used to show message sequences that are optional Academic staff can set a coursework or duplicate an existing coursework using an assessment system. The system alerts students to new assignments, and allows them to submit their work. Some students use a proofreader to check their work before submission. Submitted coursework is then sent back to the academic to be assessed. Feedback and marks are submitted to the system, which passes them on to the student. reader: ProofReader reader: ProofReader assesse : Student assesse : Student getProof() proofReadCopy opt

assesse : Student assesse : Student ecshandin : AssessmentSystem tutor : AcademicStaff reader: ProofReader reader: ProofReader setNewCswk() alertStudentToCswk() submittedCswk sendFeedback() sendMarks() duplicateCswk() [else] [existingCswk = true] alt

[proof = true] assesse : Student assesse : Student ecshandin : AssessmentSystem tutor : AcademicStaff reader: ProofReader reader: ProofReader setNewCswk() alertStudentToCswk() submittedCswk sendFeedback() sendMarks() duplicateCswk() [else] [existingCswk = true] getProof() proofReadCopy opt alt

Parallel A UML frame called ‘par’ can be used to show message sequences that occur simultaneously Academic staff can set a coursework or duplicate an existing coursework using an assessment system. The system alerts students to new assignments, and allows them to submit their work. Some students use a proofreader to check their work before submission. Submitted coursework is then sent back to the academic to be assessed. Feedback and marks are submitted to the system, which passes them on to the student. par assesse : Student assesse : Student ecshandin : AssessmentSystem tutor : AcademicStaff sendFeedback() sendMarks()

[proof = true] assesse : Student assesse : Student ecshandin : AssessmentSystem tutor : AcademicStaff reader: ProofReader reader: ProofReader setNewCswk() alertStudentToCswk() submittedCswk sendFeedback() sendMarks() duplicateCswk() [else] [existingCswk = true] getProof() proofReadCopy opt alt

[proof = true] assesse : Student assesse : Student ecshandin : AssessmentSystem tutor : AcademicStaff reader: ProofReader reader: ProofReader setNewCswk() alertStudentToCswk() submittedCswk sendFeedback() sendMarks() duplicateCswk() [else] [existingCswk = true] par getProof() proofReadCopy opt alt

[proof = true] assesse : Student assesse : Student ecshandin : AssessmentSystem tutor : AcademicStaff reader: ProofReader reader: ProofReader setNewCswk() alertStudentToCswk() submittedCswk sendFeedback() sendMarks() duplicateCswk() [else] [existingCswk = true] par getProof() proofReadCopy opt alt Is it good at answering questions like: What is the students role? For how long is the proofreader needed? Who talks with who?

Which Diagrams to Use? Activity Diagrams When analysing a use case ▫What actions are there and when do they happen? ▫This is sometimes called the Flow of Control Useful for communicating order and dependency Sequence Diagrams When analysing a use case ▫What are the key roles, how do they interact and in what order? ▫Shows the Sequence of Interaction Useful for communicating lifespans, and showing interactions over time

Summary UML Activity Diagrams model flow of control ▫Formal version of flowcharts ▫Activity Diagrams include:  Branching (decision making)  Forks and Join (parallel activities)  Swimlanes (logical partitioning) UML Sequence Diagrams model a sequence of interactions ▫Show messages passing between roles ▫Sequence Diagrams include  Lifelines  Messages and Return values  Alternatives, Optional and Parallel sequences