Open post

Place Order

The sequence diagram example shows three participating objects: Customer, Order, and the Stock. Without even knowing the notation formally, you can probably get a pretty good idea of what is going on.

  • Step 1 and 2: Customer creates an order.
  • Step 3: Customer add items to the order.
  • Step 4, 5: Each item is checked for availability in inventory.
  • Step 6, 7, 8 : If the product is available, it is added to the order.
  • Step 9 return
  • Step 10, 11: save and destroy order
Import into your Project
Open post

Break Communication Fragment

Breaks are most commonly used to model exception handling. This sequence diagram example uses a break combination fragment because it treats the balance < amount condition as an exception instead of as an alternative flow. To read this example, we start at the top left corner of the sequence and read down. When the sequence gets to the return value "balance," it checks to see if the balance is less than the amount. If the balance is not less than the amount, the next message sent is the addDebitTransaction message, and the sequence continues as normal.

Import into your Project
Open post

Using References

This sequence diagram example shows a sequence diagram that references the sequence diagrams "Balance Lookup" and "Debit Account." The sequence starts at the top left, with the customer sending a message to the teller object. The teller object sends a message to the theirBank object. At that point, the Balance Lookup sequence diagram is called, with the accountNumber passed as a parameter. The Balance Lookup sequence diagram returns the balance variable. Then the option combination fragment's guard condition is checked to verify the balance is greater then the amount variable. In cases where the balance is greater than the amount, the Debit Account sequence diagram is called, passing it the accountNumber and the amount as parameters. After that sequence is complete, the withdrawCash message returns cash to the customer.

Import into your Project
Open post

Branching with opt and alt

This is a simple sequence diagram example that shows the use of opt and alt.

opt: creates a single branch
if (condition) then
op1()
alt: creates multiple branches
if (condition1) then
op2()
else if (condition2) then
op3()
else
op4()

Import into your Project
Open post

Combined Fragment and Operation

This is a simple sequence diagram that shows the use of combined fragment.

  • Combined fragments divide a sequence diagram into different areas with different behavior.
  • Each combined fragment has an operator, one or more operands, and zero or more guard condition.
  • The operator determines how its operands execute.
  • Guard conditions determine whether their operands execute.
Import into your Project
Open post

Object Deletion

In the sequence diagram Delete Course, the :RegistrationManager issues a self call to determine if a course is available. If so, then the :RegistrationManager destroys a uml:Course.

Import into your Project
Open post

Object Creation

A sequence diagram is an interaction diagram that details how operations are carried out -- what messages are sent and when. Sequence diagrams are organized according to time. The time progresses as you go down the page. The participants (lifelines) involved in the operation are listed from left to right according to when they take part in the message sequence. The sequence diagram example here is a sequence diagram for adding a course. The lifeline initiating the sequence of messages is :Registrar

Note That:

  1. The :Registrar sends a addCourse("UML) message to a :RegistrationManager. The :RegistrationManager then sends a create() message to the Course class.
  2.  Each vertical dotted line (tail) represents the time that a lifeline exists.
  3.  Each arrow is a message call.
  4.  Activations indicate when lifeline has focus of control.
  5.  The activation bar represents the duration of execution of the message.
Import into your Project

Posts navigation

1 2 3 17 18 19 20 21 22 23 45 46 47