15 uml sequence diagrams


Published on

Published in: Technology, Education
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

15 uml sequence diagrams

  1. 1. UML Sequence Diagrams
  2. 2. Finding Behavior¡  Class and object diagrams provide a static view of the system we are modeling¡  In many cases, this is not sufficient for us to truly understand how classes interact or how the system must respond to varied run-time states¡  Therefore, UML introduces 4 types of dynamic diagrams: Sequence diagrams, Collaboration diagrams, State diagrams and Activity diagrams, collectively known as Behavioral diagrams
  3. 3. Sequence diagrams modelthe flow of use casescenarios¡  Show how objects interact with one another
  4. 4. Sequence diagramsemphasize objectsinteraction over time¡  Objects ¡  What classes we need to write ¡  Which actors need to be involved ¡  What responsibilities need to be written¡  Interaction ¡  Coupling ¡  Shows where we can reduce coupling by moving responsibilities¡  Over time ¡  The order of events ¡  Exposes where efficiency can be gained by synchronous operations
  5. 5. How do I create asequence Diagram?1.  Pick a scenario that you want to model2.  Try to identify the objects that will be involved in the scenario3.  Line them across the top in the approximate order that theyre (listed in the order that they are used for the scenario)4.  Draw dotted lines down indicating lifelines5.  Identify the first event (triggering event)6.  Draw a horizontal arrow from the object that sends a message to the object that receives it7.  identify the next event and the objects involved8.  Redo steps 6 and 7 until the diagram is complete
  6. 6. Sequence Diagrams¡  Example Sequence Diagram (fast food order) :DriveThruAttdt :FryMaker :BurgerMaker Order Value Meal Place Fry Order Place Burger Order :Customer Fill Drink Assemble Order
  7. 7. Activation bars can showwhen that object is awake
  8. 8. Sequence Diagram withactivation lines :DriveThruAttdt :FryMaker :BurgerMaker Order Value Meal Place Fry Order Place Burger Order :Customer Fill Drink Assemble Order
  9. 9. We can show the lifespan ofan object¡  The object names can be lowered from along the top to indicate when they are created during the sequence¡  We can put an X on the lifeline to show when an object is no longer needed
  10. 10. Sequence Diagrams withlifespan added :DriveThruAttdt :FryMaker Order Value Meal Place Fry Order :BurgerMaker Place Burger Order :Customer Fill Drink X X Assemble Order X
  11. 11. Conclusion¡  UML sequence diagrams help you to envision what will happen during the execution of a use case¡  They are great to help developers and business analysts get to a common understanding