3.2 Requirements Modeling

Cards (11)

  • State Representations:
    • There are 2 different characterizations of states: the state of every class as the system is preforming a function
    • The sate of the system observed from outside while the system is performing its function
    • The sate of a class can be active or passive
    • Passive sate: the current status of all attributes of an object
    • Active state: current status of the object while it is continuing transformation or processing.
  • The states of a system:
    1. State: a set of observable circumstances that characterize the behavior of a system at a given time
    2. state transition: moving from one state to another
    3. event: an occurrence that causes the system to exhibit some predictable behavior
    4. action: process that occurs as a consequence of making a transition
  • State Diagram Basics
    • The UML notation for describing a finite amount of states
    • States are round corner rectangles with the state name
    • Transitions are solid line arrows with 1 or more transition strings
    • Transition strings: describe triggers and the resulting actions
    • Initial (pseudo) state is a solid circle
    • Final state is stopping and is optional
  • State Diagram Elements
    • Transition: the relationship between states. It can have a trigger, guard condition or effect
    • Self-Transition: a transition that returns to itself. Useful for effects that are associated with a transition
    • Transition String Format: event-signature [guard]/action-expression
    • Event Signature: empty string or event name followed by a list of event-parameters in parentheses. You can chose to leave out parameter type.
    • Guard: Boolean expression in square brackets
    • Action Expression: is optional. A description of a computation done when the transition occurs
  • Optional Parts of a Transition in State Diagram
    • Trigger: the cause of the transition. Can be a signal, an event, a change in some condition, or time passing
    • Guard condition: a condition that must be true for a trigger to cause the transition
    • Effect: an action that happens directly on the object that owns the state as a result of the transition
  • State Diagram Execution
    1. There is always a current state
    2. Execution starts in initial state
    3. Event occurs
    4. If a transition has an action-expression, the action occurs when the transition takes place
    5. Machine stops when final state becomes current state
  • What happens when an event occurs ?
    • If event matches an event-signature on a transition from the current state and the guard is absent or true: the transition occurs and the current state becomes the target state.
    • If it does not match an event-signature or the guard is false: no change of state occurs
  • If the computation occurring in the current state completes, andthere is a transition from the current state with no event-signature:
    • Guard is absent or true: the target state becomes the current state.
    • Guard is false: no change of state occurs.
  • Internal Transitions
    • Entry: execute the action-expression when you enter the state
    • Exit: execute the (exit) action-expression while leaving state
    • Do: execute the (do an activity) action-expression when you enter the sate up until you exit
    • Include: action-expression names a finite process. This process is a placeholder for a nested state diagram
  • Sequence Diagram Notation
    • Objects are rectangles with names underlined and at the top
    • message are solid line arrows
    • Time is vertical
    • Lifelines are dashed lines extending down from objects
    • Activation is: rectangle on each lifeline. It represents an operation that the object does. The length is how long it takes to do the operation.
    • Truncated lifeline: ' X '
    • Solid line with triangle arrow: sync msg
    • Solid line with ->: Async msg
    • --->: sync msg return/ create instance
  • Interaction Fragments
    • Show types of message flow like loops, branches, parallel execution
    • ALT: does 1/2 actions depending on state
    • OPT: Executes if given condition is true
    • LOOP: executes multiple times based on guard
    • SD: surrounds entire sequence diagram
    • BREAK: checks if guard is true and does what's inside. If guard is false, break skips