Presentation is loading. Please wait.

Presentation is loading. Please wait.

Engineering 5895: Software Design 10/5/01Interaction Diagrams1 Modeling Behaviour Engineering 5895: Software Design.

Similar presentations


Presentation on theme: "Engineering 5895: Software Design 10/5/01Interaction Diagrams1 Modeling Behaviour Engineering 5895: Software Design."— Presentation transcript:

1 Engineering 5895: Software Design 10/5/01Interaction Diagrams1 Modeling Behaviour Engineering 5895: Software Design

2 10/5/01Interaction Diagrams 2 Typically use: capture Use Case behaviour Shows how groups of objects collaborate Only used in critical places Two forms Collaboration Diagrams Sequence Diagrams

3 Engineering 5895: Software Design 10/5/01Interaction Diagrams 3 Collaboration Diagram Teaching Machine: backup use case

4 Engineering 5895: Software Design 10/5/01Interaction Diagrams 4 Collaboration Diagram TM: Partial Class Diagram

5 Engineering 5895: Software Design 10/5/01Interaction Diagrams 5 Collaboration Diagram TM: Backup Collaboration Diagram Object Message Sequence No Self Delegation Link

6 Engineering 5895: Software Design 10/5/01Interaction Diagrams 6 Detailed Message Syntax Object names are in form of Object:Class Either or both parts may be used If class only, include the colon myA:AsomeB:B

7 Engineering 5895: Software Design 10/5/01Interaction Diagrams 7 Detailed Message Syntax Messages are labelled arrow on a link line Sequence numbers show the order Any number of messages may flow along a link myA:AsomeB:B 1: message1( ) 2: message2( ) 5: message5( )

8 Engineering 5895: Software Design 10/5/01Interaction Diagrams 8 Detailed Message Syntax Parameters may be added So may return values myA:AsomeB:B 1: deposit( amount: Money) 5: allowed := overdraft( ) : boolean Return variable name possible

9 Engineering 5895: Software Design 10/5/01Interaction Diagrams 9 Detailed Message Syntax Iteration may be indicated simple * meaning for All explicitly myA:AWindow 1*: close( ) 4*:[i:=1..10] size:=getSize(): Rectangle Iteration explicitly specified

10 Engineering 5895: Software Design 10/5/01Interaction Diagrams 10 Detailed Message Syntax Create() is a special message for construction > stereotype may be used on newly instantiated object myA:Awindow:Window 2: create( window:int) >

11 Engineering 5895: Software Design 10/5/01Interaction Diagrams 11 Message Sequencing myA:Awindow:Window aC:C theD:D msg1() 2.1:msg5() 2:msg4() 1:msg2() 1.1:msg3()2.2:msg6() Initiating message no number at all

12 Engineering 5895: Software Design 10/5/01Interaction Diagrams 12 Conditional Messages :Refereehuman:Player piece:Checker eval() 1:[isLegal]move() 1.1: mvTo() Condition clause in square brackets Message only if condition true

13 Engineering 5895: Software Design 10/5/01Interaction Diagrams 13 Mutually Exclusive Conditions myA:AsomeB:B aC:CtheD:D initM() 1a:[test]msg2() 1a.1:msg3() 1b:[!test]msg4() 1b.1:msg5() Letters designate mutual exclusion if (test) msg2() ( msg(3) ) else msg4() ( msg5() ) Note: letters carried over

14 Engineering 5895: Software Design 10/5/01Interaction Diagrams 14 Collaboration Diagrams Emphasis on static connections Show sequences by numbering messages Alternative is Sequence Diagram Different view of the same data

15 Engineering 5895: Software Design 10/5/01Interaction Diagrams 15 Sequence Diagrams Emphasis on sequence Particularly good with use cases during inception/elaboration phases classes may not be worked out yet Many designers prefer them in all phases

16 Engineering 5895: Software Design 10/5/01Interaction Diagrams 16 :ATM Customer:System insertCard() pinPrompt() enterPin() authorize() transactionPrompt() verify() checkingWithdraw() amountPrompt() amount()request() approved() offerMore() refuse() lifeline activation deletion

17 Engineering 5895: Software Design 10/5/01Interaction Diagrams 17 Message Syntax Same as for collaboration diagrams Without sequence numbers :B :D allDone() [noDs] new() :A :C *setup() setup() cleanUp() iteration condition destruction message return (optional) object creation

18 Engineering 5895: Software Design 10/5/01Interaction Diagrams 18 Concurrent Processes

19 Engineering 5895: Software Design 10/5/01Interaction Diagrams 19 Concurrent Processes


Download ppt "Engineering 5895: Software Design 10/5/01Interaction Diagrams1 Modeling Behaviour Engineering 5895: Software Design."

Similar presentations


Ads by Google