Using an alt interaction operator, it would look something like this: Let's take a look when the situation when something happens, what causes the ATM to decline de withdrawal. The else clause of the alternative combined fragment runs when no other option is selected. If there is no guard, the operand always runs when it is selected. However, as for any operand, the selected operand in the alternative structure runs only if the guard condition tests true. Only one of the offered alternatives runs on any pass through the interaction. The server confirms the withdrawal is approved and, the service passes this on to the ATM's UI and the ATM dispenses the money.Īn alternative interaction operator represents the logic equivalent of an if-then-else statement. ![]() ![]() The customer enters the data, the ATM calls a service, which calls the bank's server. I'll describe both methods using a classical example: withdraw money from an ATM when the balance is too low. They both use interaction operators, alt and break. 1Īfter searching for quite a while on how to model exception handling in a UML Sequence Diagram I found two ways to represent exception handling in a UML Sequence Diagram. There are several proposed notations for exception handling. Some clumsy approaches to model try-catch blocks are by utilizing combined fragments - alt (alternatives) and breaks, while adding stereotypes for reply messages representing thrown exceptions. ![]() UML provides neither notation to model exception handling in sequence diagrams nor any reasoning why it is absent.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |