1 / 200

UNIT 3

UNIT 3. UNIT 3. DYNAMIC MODELING. INTERACTIONS. Interaction diagrams are defined by UML to emphasize the communication between objects, not the data manipulation associated with that communication.

clariced
Download Presentation

UNIT 3

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. UNIT 3 UNIT 3 • DYNAMIC MODELING Coming up: Interaction Diagrams

  2. INTERACTIONS • Interaction diagrams are defined by UML to emphasize the communication between objects, not the data manipulation associated with that communication. • Interaction diagrams focus on specific messages between objects and how these messages come together to realize functionality. • Interaction diagrams show exactly how those objects will realize it. Coming up: Interaction Diagrams

  3. You can show the details of an interaction using several different notations; however sequence diagrams are by far the most common. Other notations include interaction overviews, communication diagrams, timing diagrams Coming up: Interaction Diagrams

  4. Sequence Diagrams

  5. ELEMENTS OF SEQUENCE DIAGRAM

  6. 1. Participants • Objects who participate in the communication. • Shown by a Rectangle.

  7. EXAMPLE : Order Processing System : User ObjectName:ClassName

  8. 2. Lifeline Coming up: Interaction Diagrams

  9. 3. Messages • Shown as a solid line pointing from the sender's lifeline to the receiver's lifeline.

  10. 3.1 Synchronous Message • If a message represents synchronous communication ( meaning the sender waits for the receiver to process the message), • You place a filled arrow head on the receiver's end.

  11. 3.2 Asynchronous Message • If the message is an asynchronous message (meaning the sender doesn't wait for the receiver to process the message), • You place an open arrowhead on the receiver's end of the line.

  12. Types of Messages Class 2 Class1

  13. 3.3 Return values • Using a dashed line with an open arrowhead.

  14. Type of Message ::: Elements : Order Processing System : User OrderItem (“UML in a Nutshell”) Confirmation Number

  15. Summary of Messages

  16. More About Scenario …. • Sequence Diagrams show how objects interact with each other and the order of occurrence. • They represent interactions for a particular scenario.

  17. FROM USECASE DIAGRAM TO SEQUENCE DIAGRAM • Refine and expand each use case…

  18. EXAMPLE

  19. Create / Destroy Objects: Coming up: Interaction Diagrams

  20. Coming up: Interaction Diagrams

  21. TYPES OF MESSAGES • SYNC, ASYNC • Lost and Found Coming up: Interaction Diagrams

  22. Found Message • You show a found message by starting the message from a black circle rather than the sender's lifeline. Coming up: Interaction Diagrams

  23. Coming up: Interaction Diagrams

  24. The CircuitBreaker doesn't care where the power surge came from; it must terminate the power in all conditions. Coming up: Interaction Diagrams

  25. Lost Message Coming up: Interaction Diagrams

  26. 4. EXECUTION OCCURRENCE • You can show an object is involved in executing some type of action (typically a method call) for a measurable amount of time using an execution occurrence. • Execution occurrences are shown as gray or white rectangles on a lifeline. • In practice, it is common to hear execution occurrences called "focus of control," Coming up: Interaction Diagrams

  27. Coming up: Interaction Diagrams

  28. 5. STATE INVARIANT • UML allows you to place labels along a lifeline to convey conditions that must be true for the remainder of the interaction to be valid. • These conditions are called state invariants . • State invariants are typically boolean expressions, Coming up: Interaction Diagrams

  29. Coming up: Interaction Diagrams

  30. 6. COMBINED FRAGMENT • 1. Critical • 2. Alt • 3. Opt • 4. Parallel • 5. Loop Coming up: Interaction Diagrams

  31. Interaction Operator • Combined Fragment Coming up: Interaction Diagrams

  32. 1. Critical • You may have a critical region within your interaction where a set of method calls must execute atomically Coming up: Interaction Diagrams

  33. Coming up: Interaction Diagrams

  34. 2. Alt • alternative interaction operator that models an if-else condition Coming up: Interaction Diagrams

  35. Coming up: Interaction Diagrams

  36. 3. Opt • Options are interaction fragments that executes only if the guard condition is True. • The interaction operator is opt. Coming up: Interaction Diagrams

  37. Coming up: Interaction Diagrams

  38. 4. Break • A break indicates that the associated interaction fragment operand should execute and then terminate the enclosing interaction. Coming up: Interaction Diagrams

  39. Coming up: Interaction Diagrams

  40. 5. Parallel • Parallel indicates that the associated interaction fragments may be merged and executed in parallel. The interaction operator is par. • UML specifies that the actual interleaving of the event occurrences of the operands must be done in such a way that the ordering in the original operand is maintained. Coming up: Interaction Diagrams

  41. For example, if the first operand consists of: • Step1 • Step2 • Step3 • and the second consists of: • StepA • StepB • StepC Coming up: Interaction Diagrams

  42. they can be merged into: Step1 StepA StepB Step2 StepC Step3 but not into: Step1 StepB Step2 StepA Step3 StepC Coming up: Interaction Diagrams

  43. Coming up: Interaction Diagrams

  44. 6. Loop • A loop indicates that the contained event occurrences are to be executed some number of times. • The interaction operator is loop. The notation for a loop includes a minimum and • maximum number of times a loop should execute. Coming up: Interaction Diagrams

  45. Coming up: Interaction Diagrams

  46. 6. COMBINED FRAGMENT • 1. Critical • 2. Alt • 3. Opt • 4. Parallel • 5. Loop Coming up: Interaction Diagrams

  47. 7. INTERACTION OCCURRENCE Coming up: Interaction Diagrams

  48. Coming up: Interaction Diagrams

  49. 8. CONTINUATIONS • Typically used with interaction references, continuations allow you to define different branches of an alternative interaction outside of the alternative itself. • Only on those specific lifelines. Coming up: Interaction Diagrams

  50. Coming up: Interaction Diagrams

More Related