1 / 12

Proposed Notation for Exception Handling in UML 2 Sequence Diagrams

Proposed Notation for Exception Handling in UML 2 Sequence Diagrams. Oddleif Halvorsen Øystein Haugen. What are UML 2 Sequence Diagrams?. Describe interaction sequences Emphasize the interaction between objects Partial descriptions

paul
Download Presentation

Proposed Notation for Exception Handling in UML 2 Sequence Diagrams

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. Proposed Notation for Exception Handling in UML 2 Sequence Diagrams Oddleif Halvorsen Øystein Haugen

  2. What are UML 2 Sequence Diagrams? • Describe interaction sequences • Emphasize the interaction between objects • Partial descriptions • May be used to verify interaction properties with respect to a specification Send event Receive event Asynchronous message Halvorsen / Haugen

  3. Why the Need for Exception Handling? ”This basic description of an object cannot be cluttered up with all of the details needed for handling the contingencies.” - Terry Winograd (1979) Halvorsen / Haugen

  4. Challenges wrt. Seq. Diagrams and Exceptions • How to visually isolate exception handling from a sequence diagram without disturbing the current semantics? • Sequence diagrams are often used to describe distributed and multithreaded environments • The scope of exception handling in modern programming languages is normally limited to one call stack • Sequence diagrams describes sets of traces • There is no call stack Halvorsen / Haugen

  5. Example Scene – Withdrawal of money from an ATM • Happy Day Scenario • Enter a card • Give the correct pin • Select a legal amount to withdraw • Receive the money and the card • Exceptions • Unrecognized card • Wrong pin • Selected too high amount to withdraw • ATM is out of money • Lost connection with the bank • Unable to deliver the money • Unable to give back card • ... Halvorsen / Haugen

  6. Handling exceptions with current standard Ensuring correct pin. Preventing the user from withdrawing more than allowed. No valid pin given. Halvorsen / Haugen

  7. Guard that triggers the exception. Reference to a diagram that handles the exception. Our Way The normal flow Adding exception flow without obstructing the normal flow Halvorsen / Haugen

  8. Dynamic Gate Matching If a gate can be matched it is combined to complete the trace Recovered from the exception. Halvorsen / Haugen

  9. Dynamic Gate Matching (continued) The normal flow diagrams Exception handling with dynamic gate matching Halvorsen / Haugen

  10. The Diagram Stack Third attempt, correct pin. • Example stack • The user enters wrong pin twice • Correct pin the third time • Each frame represent a new separate layer of diagrams. • Move between frames through the use of exception and return. Second attempt, wrong pin. The trace can now continue with the normal flow. First attempt, wrong pin. Halvorsen / Haugen

  11. Trace Semantics c: exception a: events executed before the exception <q>: trigger b: events enabled before the exception d: events after the exception • Without exceptions: U = <!m, ?m> seq <!n, ?n> • Disregarding the exception: U = a seq <q> seq b seq d • Recoverable exception: • b is a subtrace such that b contains no events on the same lifeline as that of q • c  [[e]] i.e. c is a trace in the exception • Provided d is not empty, it starts with an event on the same lifeline as q • U = a seq <q> seq (b par c) seq d where a,b,c,d are (sub)traces and seq is trace concatenation and par represents all possible merge combinations Halvorsen / Haugen

  12. Conclusion • Properties of our concepts of exception in UML Seq. Diag • Compact notation • Clear visual separation between the normal flow and the exception handling • Underpinned by precise semantics • May describe exception handling in synchronous as well as multithreaded and distributed scenarios Halvorsen / Haugen

More Related