1 / 24

Sequence Diagrams

Sequence Diagrams. Show Sequence of Interactions Between Objects. Sequence Diagrams Realize use-cases Show interaction between system objects Collaboration Diagrams are an alternative method also used in UML. Why use sequence diagrams?. Active Objects Actors or Objects

zelig
Download Presentation

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. Sequence Diagrams Show Sequence of Interactions Between Objects

  2. Sequence Diagrams • Realize use-cases • Show interaction between system objects • Collaboration Diagrams are an alternative method also used in UML Why use sequence diagrams?

  3. Active Objects • Actors or Objects • Notated using the UML notation for class instances • “Life line” appears below active objects to indicate their lifespan • Messages • Arrowed lines that indicated communication between objects Basic Elements of a Sequence Diagram

  4. Chessboard Database Chess Player make move record move critique Three Active Objects with Two Messages

  5. Synchronous message (wait for return) • Return messages (response to previous message) • Asynchronous messages (no wait) • Flat (unspecified synchronization) Note closed arrowhead Message Types

  6. Send messages <<create>> and <<destroys>> Chessboard Database <<create>> critique <<destroys>> Creating/Deleting Objects

  7. Chessboard Database <<create>> critique [unfavorable critique] <<destroys>> Conditional Messages

  8. Rectangle with rounded corners Chessboard W White to move White’s move W Black to move Object State

  9. Chessboard Database Chess Player [resign] [make move] critique Branching

  10. Chessboard Database Chess Player [game over] [make move] Alternative Flow

  11. Show when an object is involved in a sequence of messages Chessboard ChessEngine Database Request Position Request Evaluation Record Data Control Rectangles

  12. Chess Client Chess Server Diagonal message lines indicate that the messages take time to transmit Send Player’s Move Send Opponent’s Move Modeling Time

  13. Chess Client Chess Server {sendTime for player’s move<2 seconds} Send Player’s Move Send Opponent’s Move Specifying a Time Constraint on a message

  14. Chess Client Chess Server Send Player’s Move {Roundtrip time < 1 second} Send Opponent’s Move Specifying a time constraint on a section

  15. Chess Client Chess Server Send Player’s Move Send Opponent’s Move Modeling Loops *[while !gameOver]

  16. Application Sorter Sort List Sort List Modeling Recursion

  17. Web Interface Database GPA = RequestGPA(studentName) Arguments and Return Values

  18. Chess Client Chess Server Send Player’s Move Send a move and get a move. If connection is lost, an automatic reconnect is attempted. Send Opponent’s Move Adding Notes to Diagrams

  19. They look like activity diagrams, but they are showing state transitions. Statechart Diagrams

  20. Start Symbol End Symbol State Symbol (contains state name) Decision Points Symbols

  21. Events are indicated by adding labels to the edges between states Events

  22. Actions show the behavior associated with an action • Actions are: • Entry – what happens on entry • Exit – what happens on exit • Do – what happens while in the state • Include – an additional statechart diagram • Event – how to respond to an event Actions

  23. For non-events • Action-label/action for non-events • For events • Event-name(parameters) [guard] /action • Examples: • Entry/numberOfStudents=0 • RestUsers(users) [Users->forAll(Open = False)] / users->empty Action Notation

  24. Data State Deleted Exit/ Reset Cancel/ EmptyData() Data Entered / RecoredData() Clean Dirty Continue/ SaveData() Exit/ Reset() Saved Example (from Roff)

More Related