1 / 42

Chapter 15

Chapter 15. UML Interaction Diagrams. 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

lynne
Télécharger la présentation

Chapter 15

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 15 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. Fig. 15.1 Sequence Diagram

  4. Fig. 15.2 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. Fig. 15.3 Example Sequence Diagram:makePayment

  7. Fig. 15.4 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. Fig. 15.5 Illustrating Participants with Lifeline Boxes

  11. Fig. 15.6 Singleton Objects

  12. Basic Sequence Diagram Notation

  13. Fig. 15.7 Messages and Focus of Control

  14. Fig. 15.8 Two ways to show reply or return result

  15. Fig. 15.9 Message to “self” or “this”

  16. Fig. 15.10 Creation of Instances

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

  18. Fig. 15.12 Frame for a looping construct

  19. Fig. 15.13 Frame for a conditional message

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

  21. Fig. 15.15 Mutually Exclusive Conditional Messages

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

  23. Fig. 15.17 Iteration over a Collection • This alternative is more implicit.

  24. Fig. 15.18 Nesting of Frames

  25. Fig. 15.19 Interaction Occurrence: Reference

  26. Fig. 15.20 Invoking class (static) methods

  27. Fig. 15.21 Polymorphic Messages and Cases

  28. Fig. 15.22 Asynchronous Calls and Active Objects

  29. Basic Communication Diagram Notation

  30. Fig. 15.23 Link lines • Visibility between objects: an association • Navigation: path along which messages flow

  31. Fig. 15.24 Messages

  32. Fig. 15.25 Messages to “self” or “this”

  33. Fig. 15.26 Creation of Instances

  34. Fig. 15.27 Message Number Sequencing

  35. Fig. 15.28 Complex Sequence Numbering

  36. Fig. 15.29 Conditional Messages

  37. Fig. 15.30 Mutually Exclusive Conditional Paths

  38. Fig. 15.31 Iteration (Looping)

  39. Fig. 15.32 Iteration over a Collection

  40. Fig. 15.33 Invoking a class (static) method

  41. Fig. 15.34 Polymorphic Messages and Cases

  42. Fig. 15.35 Asynchronous call and active object

More Related