Modeling behavior with Sequence diagrams

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Modeling behavior with Sequence diagrams - Presentation Transcript

    1. Session 5:Modeling Behavior with UML Sequence Diagrams
      Analysis and Specification of Information Systems
      Spring 2008
      Eran Toch
      http://www.technion.ac.il/~erant
    2. Outline
      Introduction
      Basic notation
      Alternating paths
      Modularity
    3. Modeling Process
      Introduction | Basics | Alternations | Modularity
    4. Why to Model Behavior?
      How do we use the SMS Server interface? What is the order of executing the operations?
      sendMessage, getStatus, Resend?
      getStatus, sendMessage, checkForMessages?
      When do we use resend?
      Introduction | Basics | Alternations | Modularity
    5. Behavioral Modeling
      [if getStutus == err]
      Send message
      Resend
      Resend
      Get Status
      Adds a new msg
      Message queue
      Introduction | Basics | Alternations | Modularity
    6. Outline
      Introduction
      Basic elements
      Alternating paths
      Modularity
    7. Building a Sequence Diagrams
      Sequence diagrams capture the use-case behavior using the foundation of the classes.
      Use Case 1
      Class C
      Class A
      Use Case 3
      Use Case 2
      Class D
      Class B
      Objects
      Sequence =
      +
      messages
      Introduction | Basics | Alternations | Modularity
    8. Sequence Diagrams
      A simple sequence diagram:
      objects
      sd Product Buying
      Diagram Name
      p : Product
      : ShooppingCart
      customer
      display()
      message
      getPrice()
      activation (focus of control)
      addProduct (p)
      checkout ()
      Lifeline
      Introduction | Basics | Alternations | Modularity
    9. Object Control
      obj1 : Class1
      Illustration
      obj2 : Class2
      obj1 : Class1
      user
      Object Creation
      operate()
      do (…)
      create (…)
      : Class3
      Return Message
      foo()
      Messages to self
      Object Destruction
      Introduction | Basics | Alternations | Modularity
    10. Illustration
      Corresponding Class Diagram
      Notice that a dependency exists whenever messages are passed between instances of the class
      Dependencies can be overridden by associations, aggregations etc.
      Introduction | Basics | Alternations | Modularity
    11. Sequences and Use-Cases
      p : Product
      : ShooppingCart
      customer
      display()
      getPrice()
      addProduct (p)
      checkout ()
      create (…)
      : Order
      Hidden part
      Visible part
      Introduction | Basics | Alternations | Modularity
    12. Full Message Attributes
      sequence number
      [sequence-expression]
      [return-value :=] [message-name] [(argument-list)]
      C3.1: res := getLocation (fig)
      message name
      argument list
      return value
      Introduction | Basics | Alternations | Modularity
    13. Different Kinds of Messages
      Synchronous Message
      asynchronousMessage
      Return Message
      Introduction | Basics | Alternations | Modularity
    14. Synchronous & Asynchronous Messages
      Example
      Example
      Nested Flow
      Asynchronous Flow
      manager
      sensor
      eye
      sensor
      manager
      alarm
      check
      unknown
      unknown
      ring
      check
      operate
      log
      Price need to be finished, before teller can do another operation (getName)
      Ring is executed, while the control flow is returned to err handle and appl
      Introduction | Basics | Alternations | Modularity
    15. Outline
      Introduction
      Basic elements
      Alternating paths
      Modularity
    16. Flow Constructs
      If
      Loop
      Else
      Repeat
      Jump
      When we tell a scenario, which types of alternatives do we need?
      Introduction | Basics | Alternations | Modularity
    17. Options
      Example
      msg : Message
      : Database
      Fragment
      opt
      Condition
      [msg.status=confirmed]
      archive(msg)
      Used for modeling simple optional blocks.
      Has one operand; no "else" guard.
      Do something...
      Introduction | Basics | Alternations | Modularity
    18. Alternatives
      msg : Message
      : Database
      : Admin
      alt
      Alternative Fragment group
      [msg.status=confirmed]
      archive(msg)
      Condition
      [msg.status=error]
      notify(msg.getID())
      [else]
      Execution regions. At most one will execute.
      wait()
      Else condition
      (optional)
      Introduction | Basics | Alternations | Modularity
    19. Loops
      : OS
      : Folder
      : File
      loop
      [for each Folder]
      Loop Fragment
      Display()
      loop
      [for each File]
      Condition
      Display()
      Nested Loop Fragment
      Introduction | Basics | Alternations | Modularity
    20. Breaks
      : Policy
      : User
      : User Manager
      isLooged = login(name,pass)
      If the condition is met, the break fragment is executed, and the reminder of the sequence is ignored
      break
      [¬isLooged]
      addBadLogin(name)
      Do something…
      Handy in model exception handling
      Do something …
      Introduction | Basics | Alternations | Modularity
    21. Examples of Guards
      [for each Object]
      [5]
      [i=1..5]
      [status = okay]
      No guard means an infinite loop
      Introduction | Basics | Alternations | Modularity
    22. Outline
      Introduction
      Basic elements
      Alternating paths
      Modularity
    23. MODULARITY
      We need ways to create modular scenarios
      Introduction | Basics | Alternations | Modularity
    24. Referencing a diagram
      : Policy
      : User
      : User Manager
      login(name,pass)
      ref
      Login Handling(user,pass) :bool
      Reference Gate
      Do something…
      Do something …
      Introduction | Basics | Alternations | Modularity
    25. Referenced Diagram
      sd Login Handling
      Diagram name
      : User Manager
      : UserAccount
      loop
      Input message
      login(name,pass)
      [for each UserAccount]
      cName -= getUseNamer()
      cName -= getUseNamer()
      Output message
      opt
      [cName = name]
      isInSystem(true)
      true
      false
      Introduction | Basics | Alternations | Modularity
    26. Summary
      • Behavior Modeling
      Sequence models interaction
      • Language
      Objects + lifeline
      Messages
      • Alternations
      Loops
      Alternatives
      • Modularity
      Referencing
      Introduction | Basics | Alternations | Modularity

    + Eran  TochEran Toch, 4 months ago

    custom

    642 views, 0 favs, 0 embeds more stats

    Modeling software interaction and behavior with seq more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 642
      • 642 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 26
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories