CSSE 374: Interaction Diagrams Steve Chenoweth Office: Moench Room F220 Phone: (812) 877-8974 These slides and others derived.

Slides:



Advertisements
Similar presentations
Chapter 15 UML Interaction Diagrams 1CS6359 Fall 2012 John Cole.
Advertisements

CSSE 374: Object-Oriented Design Exercise Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and.
Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Robert B. Jackson Brigham Young University John W. Satzinger
CSSE 374: Introduction to Object- Oriented Analysis and Design Q1 Steve Chenoweth Office: Moench Room F220 Phone: (812)
Sequence Diagram Objects are represented horizontally across the top of the diagram Each object has a lifeline some exist before and/or after some are.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Chapter 15 Interaction Diagrams. Most Common Sequence Diagram Communication Diagram Sequence Diagrams illustrate interactions between classes of a program.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.
SE-565 Software System Requirements More UML Diagrams.
Designing with Interaction and Design Class Diagrams Chapters 15 & 16 Applying UML and Patterns Craig Larman With some ideas from students in George Blank’s.
Domain Modeling Chandan R. Rupakheti and Steve Chenoweth Week 5, Day 1.
CSSE 374: More GRASP’ing and Use Case Realization Steve Chenoweth Office: Moench Room F220 Phone: (812) These.
CSSE 374: Design Class Diagrams Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and others.
CSSE 374: Domain Model Refinements and Iteration 3 Preparations Q1 These slides and others derived from Shawn Bohner, Curt Clifton, Alex Lo, and others.
UML Sequence Diagrams Reading: UML Distilled Ch. 4, by M. Fowler
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Object-Oriented Analysis and Design Feb 9, 2009.
CS3773 Software Engineering
CSSE 374: Operations Contracts and Logical Architectures Steve Chenoweth Office: Moench Room F220 Phone: (812)
CSSE 374: GRASP’ing at the First Five Patterns Principles Steve Chenoweth Office: Moench Room F220 Phone: (812)
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
Object-Oriented Design
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
CSSE 374: More Object Design with Gang of Four Design Patterns Steve Chenoweth Office: Moench Room F220 Phone: (812)
Chandan Rupakheti Office: Moench Room F203 Phone: (812) These slides and others derived from Shawn Bohner, Curt.
1 SAD2 - UML 2 nd Lecture Sequence Diagram and other dynamic views Lecturer: Dr Dimitrios Makris
CSSE 374: 3½ Gang of Four Design Patterns These slides derived from Steve Chenoweth, Shawn Bohner, Curt Clifton, and others involved in delivering 374.
Introduction to Interaction Diagrams Used to illustrate the dynamic behaviour of a community of objects that collaborate by passing messages in order to.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
Review ♦ System sequence diagram ♦ Domain model
CSSE 374: More GRASP’ing for Object Responsibilities
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML Sequence Diagrams.
Jan 21, Ron McFadyen1 Ch 10. Domain Model: Visualizing Concepts Domain model illustrated with a class diagram (with no operations defined)
Starting Object Design
Chapter 4: UML Interaction Diagrams. Objective Provide a reference for frequently used UML interaction diagram notation- sequence and communication diagrams.
Chapter 9 Applying UML and Patterns -Craig Larman
1 UML Sequence Diagrams UML Distilled, Third Edition, Chapter 4 M. Fowler.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
What to remember from Chap 13 (Logical architecture)
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Interaction Diagram Notation
Object-Oriented Analysis and Design Feb 11, 2009.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
Object-Oriented Analysis and Design 1 Mira Balaban & Arnon Sturm Object-Oriented Analysis and Design Session 3a: Behavioral Modeling - Interactions.
Use Case Driven Analysis Requirements Use Case Use Case Description System Sequence Diagram Chapter 5.
1 On To Object Design Chapter 14 Applying UML and Patterns -Craig Larman.
System Sequence Diagram Chandan Rupakheti & Steve Chenoweth Week 5-3a.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
(14-2) UML Instructor - Andrew O’Fallon CptS 122 (December 2, 2015) Washington State University.
Coming up: Interaction Diagrams Sequence Diagrams Dan Fleck.
Coming up: Interaction Diagrams Sequence Diagrams Dan Fleck.
Chapters 10, 11 SSD (Revision) SD DCD Exam Object-Oriented Design.
Dr. Kivanc DincerCS319 Week 6 - Oct.17,20051 Chapter 14 Onto Object Design Objectives Understand dynamic and static object design modeling. Try agile modeling,
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
UML Activity and Sequence Diagrams David Millard
Sequence diagrams Lecture 5. Main terms  Interaction  Life line  Activation  Executable behavior and derived behavior  Messages  Trajectory  Frame.
CSSE 374: UML Activity Diagrams
System Sequence Diagrams and Operation Contracts
UML Interaction Diagrams
Chapter 11: Collaboration Diagram - PART1
Sequence Diagram.
CSSE 374: Domain Model Refinements and Iteration 3 Preparations
UML Sequence Diagrams.
Princess Nourah bint Abdulrahman University
System Sequence Diagrams
IMAT5205 Systems Analysis and Design
Interaction Diagrams A Lot of UML!
Presentation transcript:

CSSE 374: Interaction Diagrams Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and others derived from Shawn Bohner, Curt Clifton, Alex Lo and others involved in delivering 374. Chandan Rupakheti Office: Moench Room F203 Phone: (812) How does a horse really run? Photo sequence in which Eadweard Muybridge proved a horse lifts all four feet off the ground as it runs.

From last time – Prefer Design Skill over UML Skill UML is only a tool for object design The real skill is the design, …NOT the diagramming Fundamental object design requires knowledge of:  Principles of responsibility assignment  Design patterns And design in the real world takes domain knowledge, too… 

Learning Outcomes: O-O Design Demonstrate object-oriented design basics like domain models, class diagrams, and interaction (sequence and communication) diagrams. Outline Dynamic/Behavior Design concepts Introduce Interaction Diagrams Describe Key Sequence Diagram Concepts Describe Key Communications Diagram Concepts

Interaction Diagrams Used for dynamic object modeling  Answer questions about behavior (i.e., events, sequencing) Two common types:  Sequence diagrams  Communication diagrams Don’t confuse with System Sequence Diagrams (SSDs), which use a subset of the notation Q1,2 Spend time on interaction diagrams, not just class diagrams 

Sequence Diagram Example public class A { private B myB = new B(); public void doOne() { myB.doTwo(); myB.doThree(); } } public class A { private B myB = new B(); public void doOne() { myB.doTwo(); myB.doThree(); } } 

Communication Diagram Example public class A { private B myB = new B(); public void doOne() { myB.doTwo(); myB.doThree(); } } public class A { private B myB = new B(); public void doOne() { myB.doTwo(); myB.doThree(); } } 

Relative Strengths Sequence Diagrams (SD)  Clearer notation & semantics  Better tool support  Easier to follow  Excellent for documents Communication Diagrams (CD)  Much more space efficient  Easier to modify quickly  Excellent for UML as sketch 

Common Notation

Lifeline Boxes Q3

Basic Message Expression Syntax id = message(parameter : parameterType) : returnType Much is optional, for example: initialize(register) initialize d = getProductDescription(id) d = getProductDescription(id:ItemID) d = getProductDescription(id:ItemID) : ProductDesc 

Sequence Diagrams (SD) (when order is key)

Basic SD Terminology Found message Execution specification bars Synchronous messages Q4 

Two Ways of Illustrating Return Values returnVar = message(parameter) Using return or reply message 

Instance Creation Conventional message name Instance of… Note dashed line! 

Instance Destruction “stereotype”“stereotype” 

Speaking of Sales… Recall Interaction Frames Frame operator GuardGuard 

Common Frame Operators OperatorMeaning alt “alternative”, if-then-else or switch “alternative”, if-then-else or switch loop loop while guard is true, or loop(n) times loop while guard is true, or loop(n) times opt optional fragment executes if guard is true optional fragment executes if guard is true par parallel fragments parallel fragments region critical region (single threaded) critical region (single threaded) ref a “call” to another sequence diagram a “call” to another sequence diagram sd a sequence diagram that can be “called” a sequence diagram that can be “called”

Mutual Exclusion “alt” Frame Divides sections of frame Q5

Iterating Over a Collection—Version 1 Action box contains arbitrary statements from implementation language – increment i One instance from a collection 

Iterating Over a Collection—Version 2 Leaves the loop implicit.

Abstracting Interaction Interaction occurrence ref frames sd frames Q6 

Asynchronous Calls Asynchronous (non-blocking) call Synchronous (blocking) call Active object has its own thread 

Exercise on Sequence Diagrams Break up into your project teams Given the following:  Select a number of videos in preparation to purchase and put them in a list (cart)  Involve Classes/Lifeline Boxes: Customer, Video, and Video Description  Invent other classes if you need them! Draw an SD for Rent Video example Q7

Store Address Phone# Customer name address phone# Video ID Transaction date Payment /amount: Money type authorization Initiates   Records- rental-of Pays-for  Transacts  Rents-from, Buys-from  Stocks  Selects  *1 1 * * 1 * 1..* * 1 Makes- Authorizes  1 1..* Rental dueDate ReturnDate ReturnTime VideoDescription title subjectCategory VideoSupplier address name newVideos Baske t Shelf location stock Membership ID startDate PricingPolicy perDayRentalCharge perDayLateCharge 1 Obtains  1 1  Maintains 1 * Determines- rental-charge  1 *  Contains 1 * * 1  Stores- video-on  Defines 1 *  Provides 1 * * Describes  Contains  1 0..*  Provides 1 0..* 1 1  Holds- videos-in 1

An SD Solution for Rent Video Example :Video findVideoToRent(ID,duration) Loop [more items] videoTitle, availability Checkout totalWithTaxes :Customer rentVideos :Video Description getVideoInfo(ID,duration) videoTitle, desc, availabilty selectVideoToRent(ID) selectedVideos(video List) updateAvailability(ID,duration)

Communi- cation Diagrams (CD)

Links vs. Messages Single link connects two objects Multiple messages traverse links Sequence number gives ordering Q8 

Sequence Numbering – Following Flow No number on “found” message Nested messages use “legal” style 

Conditional Messages Use Guards Q9a Take different paths based on Test and ~Test conditions

Iteration Uses Stars (splats ***) Q9b Iteration is indicated with “*” Note: 1 * [i=1..n]: st = getSubtotal 

Asynchronous Calls Asynchronous (non-blocking) call Synchronous (blocking) call Q10 Active object 

Exercise on Communications Diagrams Break up into your project teams – if time Given the following:  Select a number of videos in preparation to purchase and put them in a list (cart)  Involve Classes/Lifeline Boxes: Customer, Video, and Video Description Draw an CD for Rent Video example Q10

A CD Solution for Rent Video Example :Video 1: FindVideoToRent(ID,duration)  1.3: videoTitle, availability  3: Checkout  3.2: totalWithTaxes  :Customer rentVideos  :Video Description 1.1: getVideoInfo(ID,duration)  1.2: videoTitle, desc, availabilty  2: selectVideoToRent(ID)  3.1: selectedVideos(video List)  2.1: updateAvailability(ID,duration) 