Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Diagrams

269 views

Published on

Compilation of diagrams I found here..
Sequence Diagrams
State Transition Diagrams
Activity Diagrams

Credits to the owner

Published in: Data & Analytics
  • Be the first to comment

  • Be the first to like this

Diagrams

  1. 1. Sequence Diagram Systems Analysis and Design
  2. 2. Introduction to Sequence diagram Sequence diagram is interaction diagram that shows the set of objects and messages send and receive by those object. It mainly emphases on time ordering and messages. It is used to illustrate the dynamic view of system. These are also called as “Isomorphic diagram”.
  3. 3. Terms and Concepts Objects or Participants :-  The sequence diagram is made up of collection of participants or objects. Participants are system parts that interact each other during sequence diagram.  The participants interact with each other by sending and receiving message  The object is represented by as below: Object:Class_Name
  4. 4. Terms and Concepts Lifeline:-  Lifeline represents the existence of an object over a period of time.  It is represented by vertical dashed line.  Most objects that appeared in ‘Interaction diagram’ will be in existence for the duration of an interaction. So, these objects are aligned at top at top of diagram with their lifeline from top to bottom of diagram.
  5. 5. Terms and Concepts Activation bar:-  It is also called as focus of control. It shows the period of time during which an object is performing an action.  The top of rectangle is aligned with start of the action. The bottom is aligned with its completion and can be marked by a written message  It is represented by tall thin rectangle:
  6. 6. Terms and Concepts Messages:-  The interaction in a sequence diagram between the objects can be shown by using messages.  The messages on sequence diagram are specifies using an arrow from participant that wants to pass the messages to the participant that receive the messages .  Messages can be flow in whatever direction required for interaction from left to right and right to left.
  7. 7. Terms and Concepts Messages:-  It has following kinds of messages: 1)Synchronous messages:- * It is a message where the sender is blocked and waits until the receiver has finished processing of message. * It is invoked the caller waits for the receiver to return from the message invocation. * It is represented by solid line with full arrow. 2)Asynchronous messages:- * It is a messages where the sender is not blocked and can continue executing. * It is represent by solid line with half arrow.
  8. 8. Terms and Concepts Messages:-  It has following kinds of messages: 3)Reflexive messages:- * If the object sends the message to itself then it is called as ‘Reflexive message. * It is represented by solid line with loops the lifeline of object. 4)Return messages:- * It can be used at the end of activation bar to show that control flow of activation returns to the participant that pass the original message. * It is represent by dashed line from sender to receiver.
  9. 9. Terms and Concepts  It has following kinds of messages: 5)Create messages:- * It is used to create object during interaction. * The object can be created by using <<create>> to indicate the timing of creation. * Creating message can be shown as below: 6)Destroy messages:- * It is used to destroy the objects during interaction. * The objects can be terminated using <<destroy>> which points to an “x”. * It indicates that object named message is terminated.
  10. 10. Terms and Concepts Time:-  The sequence diagram describes the order in which interaction takes place.  So time in an important factor. The time on sequence diagram starts at top of the page just below the object and then progress down the page.  Time is all about ordering but not duration.
  11. 11. Terms and Concepts Event:-  It can be referred as smallest part of an interaction and event can occur of at any given point in a Time.  When interaction take place, Events are called as build in blocks for messages and signals.  Event is created while sending and receiving message.
  12. 12. Sequence diagram of Railway reservation system
  13. 13. State Transition Diagrams Systems Analysis and Design
  14. 14. State Transition Diagrams • State diagrams describe the life of an object using three main elements: • States of an object • Transitions between states • Events that trigger the transitions • A state diagram specifies a state machine • A state machine is described for a class • Each object has it’s own state machine
  15. 15. States • State • is a condition or situation during the life of an object within which it performs some activity, or waits for some events • Has a name • Has actions -- execute the state • Has internal transitions -- transitions cause no change in a state • substates -- the nested structure of a state involving disjoint or concurrent substates
  16. 16. States • For example: entry/unlock door do/prepare materials telephone rings/answer telephone include/lecture state exit/lock door At Work state name action performed on entry to state activity performed while in state action performed on arrival of named event name of a sub-state machine action performed on leaving state
  17. 17. Initial and Final States • The initial state of a state machine is indicated with a solid circle • Known as a pseudo-state • A transition from this state will show the first real state • The final state of a state machine is shown as concentric circles • A closed loop state machine does not have a final state; the object lives until the entire system terminates • An open loop state machine represents an object that may terminate before the system terminates
  18. 18. Initial and Final States • An example: At Work At Homego home go to work die die
  19. 19. Actions and Activities • Action • is an executable atomic computation • includes operation calls, the creation or destruction of another object, or the sending of a signal to an object • associated with transitions and during which an action is not interruptible -- e.g., entry, exit • Activity is associated with states • Non-atomic or ongoing computation • May run to completion or continue indefinitely • Will be terminated by an event that causes a transition from the state in which the activity is defined
  20. 20. Events • An event signature is described as Event-name (comma-separated-parameter-list) • Events appear in the internal transition compartment of a state or on a transition between states • An event may be one of four types • Signal event • Corresponding to the arrival of an asynchronous message or signal • Call event • Corresponding to the arrival of a procedural call to an operation • Time event • Change event
  21. 21. Events • A time event occurs after a specified time has elapsed • Event name is specified as keyword after • Parameter list is an expression evaluating to a time interval • after(10 seconds after state “At Work” is entered) • No specified start time implies “since entry to the current state” • after(2 seconds)
  22. 22. Events • A change event occurs whenever a specified condition is met • Event name is specified as keyword when • Parameter list is a boolean expression • The event occurs when both of the following conditions are met, irrespective of the order when they happen • The expression evaluates to true • The object is in the required state • For example • when (state = At Work) • when (date = January 1 2007)
  23. 23. Transitions A transition is drawn as an arrow between states annotated with a transition string • The transition string denotes the event and consequent action • Only one form of arrowhead is used on statecharts • The distinction between call events and signal events must be deducted from elsewhere e.g. an interaction diagram A transition string is described as • Event-signature [guard-condition]/action-expression^object.message • If the guard condition is met the transition occurs immediately
  24. 24. Transitions • A transition is triggered when its event occurs • If the guard condition is met, the transition is fired • If the condition is not met the event is discarded • The guard condition is checked only once • If there is no guard condition, triggering will always cause firing • Note the distinction between a guard condition and a change event • A guard condition is evaluated once, when the associated event occurs • A change event occurs whenever its associated condition is met • Behaviour is as if the condition were being continually evaluated
  25. 25. State Diagrams notation PaidUnpaid paying Invoice created Invoice destroyed name state final stateInitial state transition event
  26. 26. State Diagram Example on loan entry / myBkCpy.borrow() on the shelf entry / myBkCpy.return() borrow() return() on loan exit / myBkCpy.returned() on the shelf exit / myBkCpy.borrowed() borrow() return() Entry action : any action that is marked as linked to the entry action is executed whenever the given state is entered via a transition Exit action : any action that is marked as linked to the exit action is executed whenever the state is left via a transition This shows the state of an object myBkCpy from a BookCopy class
  27. 27. A Class of BookCopy BookCopy onShelf : Boolean value := ‘Y’ on the shelf value := ‘N’ on loan return() borrow() action / onShelf=‘Y’ action / onShelf=‘N’
  28. 28. State Diagram - Nested States Super-state A B event-1 C event-2 A B C event-1 event-2event-2
  29. 29. Checking do / check Item Dispatching do / initiate delivery Delivering [all items checked && some items not in stock] Order item [all items checked && all items available] Dispatch items delivery get first item Cancelingcancelled Ordering Exit/ Item received do / order Item *[all items checked] get next item entry / deliver Items do / Remove Item State Diagram Example including substates
  30. 30. Concurrent State models  Orthogonal Components and Concurrency  shown separated by dashed line  supports concurrency  Objects must be in only one state from each of the orthogonal components Starting A Finishing B C E F D G Explicit control branching(fork) s T
  31. 31. Concurrent State Models Three different ways for orthogonal components to communicate: • Broadcast Events • Propogated Events • IN operators
  32. 32. Concurrent State Models • Broadcast events • events that more than one orthogonal component accepts • For example an event T1 is sent to all active orthogonal components it need not be acted on by all components • what happens if component S1 is in state A, S2 is in state E and S3 is in state G when a T1 event occurs? • what happens if S1 is in state A and S2 is in state D when the event T1 occurs?
  33. 33. Concurrent State Models • Propagated events are indicated with the caret following the event name (and optional parameters and guard) • IN operators are used as a guard on transition T4. This allows the S3 component to take the transition T4 only if S2 is currently in state D
  34. 34. Concurrent State Models A B C E F D G S1 T3(a,b,c) H H T1 T2^T3(x,y,z) H T1 S2 T4[IN(D)] T3(a,b,c) S3 T5 T6 S
  35. 35. Activity Diagrams Systems Analysis and Design
  36. 36. Modeling Process Phase Actions Outcome Initiation Raising a business need Business documents Requirements Interviewing stakeholders, exploring the system environment Organized documentation Specification Analyze the engineering aspect of the system, building system concepts Formal specification Design Define architecture, components, data types, algorithms Formal Specification Implementation Program, build, unit-testing, integrate, documentation Testable system Testing & Integration Integrate all components, verification, validation, installation, guidance Testing results, Working sys Maintenance Bug fixes, modifications, adaptation System versions
  37. 37. Behavior Modeling Checkout Manager Order message: change status Add to cart Check availability Supply Order Notify User [okay][problem] Sequence Diagrams Activity Diagrams Inventory message: create In process supplied Order State Diagrams
  38. 38. Strengths • Best for modeling complex behavior • Which does not rely on interactions. • Has parallel behavior. • Examples: • Business workflow (authorizing a loan). • User behavior (login/logout). • Algorithms.
  39. 39. Activity Diagram for Customer Service Start Fork decision merge Join Final Node Action
  40. 40. Tokens Each fork node generates tokens, according to the number of paths. The initial node creates a single token Each join “collects” all the incoming tokens, producing a token afterwards. An action requires a token to execute, and produce a token when it ends
  41. 41. Object Flows • Objects describe the interface between actions Call DataReceive Call Log Call Receive Call Log Call Object Flow Pins Call data Call data Initiate Call Call data
  42. 42. Objects with States Object nodes allow state change modeling. Call Data [created] Receive Call Find Customer Type Call Data [classified]
  43. 43. Data Store • A datastore is a stereotype for an object which stores objects persistently. All entering tokens are copied so that tokens never leave the data store If a token is already present in the data store, it replaces the old one
  44. 44. Catching Signals Time Signal Event Signal Flows when the time expression is true Flows when an event occurs Sends an event when a flow enters
  45. 45. Example: Volvo Blind Spot Info System (BLIS)
  46. 46. Camera Behavior Check Objects in Camera Is object Detected?[no] Side Object Detected [yes] Safety Controller Behavior Side Object Detected Detection data Alarm Deciding Side? Left Alarm Right Alarm [left] [right]
  47. 47. Final Nodes the activity is terminated when the first token arrives the activity is terminated when all tokens in the graph are destroyed
  48. 48. • An action can be decomposed into an subactivity. • The invoked activity graph can be used by many subactivity states. Decomposition Input Parameter Final Action
  49. 49. Partitions • Partitions (swimlanes) can group actions by: • class, business unit, person etc… • Can be multidimensional (not always possible). Register Bug Evaluate Impact Fix Bug Revise Plan Release Fix Test Fix [ priority = 1] Management Support Engineering
  50. 50. Pre / Post Conditions for Decompositions for Actions
  51. 51. Exceptions • Exception represent errors and unexpected situations interruptible region Exception Edge What happens to the tokens? Exception Handler
  52. 52. Multiple events Actions can throw events too Exception info can be modeled Multiple event handlers

×