Presentation is loading. Please wait.

Presentation is loading. Please wait.

UML Interaction Diagrams

Similar presentations


Presentation on theme: "UML Interaction Diagrams"— Presentation transcript:

1 UML Interaction Diagrams

2 Dynamic Object Modeling
Interaction diagrams: Sequence diagram Participants (objects) across the top Time proceeds down the diagram Communication diagram Objects can be placed anywhere (relative to each other) = compact Sequence numbers indicate call-flow sequence (harder to read)

3 Sequence Diagram

4 Communication Diagram

5 Mapping an Interaction Diagram to Code
public class A { private B myB = new B(); public void doOne() myB.doTwo(); myB.doThree(); }

6 Example Sequence Diagram: makePayment

7 Example Communication Diagram: makePayment

8 Code related to the Sale class
public class Sale { private Payment payment; public void makePayment ( Money cashTendered) payment = new Payment( cashTendered ); . . . }

9 Common UML Interaction Diagram Notation

10 Illustrating Participants with Lifeline Boxes

11 Singleton Objects

12 Basic Sequence Diagram Notation

13 Messages and Focus of Control

14 Two ways to show reply or return result

15 Message to “self” or “this”

16 Creation of Instances

17 Object Destruction Use only if you need to show the destruction of an object explicitly (e.g., C++)

18 Frame for a looping construct

19 Frame for a conditional message

20 Simple UML 1.x style for conditional message
Not legal in UML 2, but still useful for sketching

21 Mutually Exclusive Conditional Messages

22 Iteration over a Collection
UML does not provide an official idiom for iteration This suggested notation is relatively explicit.

23 Iteration over a Collection
This alternative is more implicit.

24 Nesting of Frames

25 Interaction Occurrence: Reference

26 Invoking class (static) methods

27 Basic Communication Diagram Notation

28 Visibility between objects: an association
Link lines Visibility between objects: an association Navigation: path along which messages flow

29 Messages

30 Messages to “self” or “this”

31 Creation of Instances

32 Message Number Sequencing

33 Complex Sequence Numbering

34 Conditional Messages

35 Mutually Exclusive Conditional Paths

36 Iteration (Looping)

37 Iteration over a Collection

38 Invoking a class (static) method

39 Polymorphic Messages and Cases

40 Asynchronous call and active object


Download ppt "UML Interaction Diagrams"

Similar presentations


Ads by Google