Information Systems Analysis and Design CSC340 Information Systems Analysis and Design State Diagrams Statecharts IV State and Activity Diagrams Diagrams These are state transition diagrams with some interesting additions which can be used to describe the operating environment of the system interactions of the system with that environment also the lifetime of some object a person a student within or without the system Transitions are supposed to represent actions which occur quickly and are not interruptible A transition can have an associated triple Event Condition Action all parts of this triple are optional States are supposed to represent longer running activities or other things What constitutes quickly and longer running depends on the application State Diagrams Events and States Superstates Activity Diagrams Petri Nets 2002 Jaelson Castro and John Mylopoulos Statechart Diagrams 1 Information Systems Analysis and Design CSC340 2001 Jaelson Castro and John Mylopoulos get order Dispatching all items in stock Do package items start some item not In stock event action deliver package Item received all items in stock Item received some item not In stock CSC340 Events condition Do check items State and Activity Diagrams 2 Information Systems Analysis and Design State Diagram for Purchase Order Order Checking CSC340 An event is a happening that the system needs to know about For example completing an assignment failing an exam or a system crash are all events An event may trigger an action by an actor or the system being developed In UML there are four types of events Change events occur when a condition becomes true e g when balance 0 Signal events designate the receipt of an explicit real time signal from one object or actor to another Call events indicate the receipt of a call for an operation by an object or actor Time events mark the passage of a designated period of time e g after 10 seconds Waiting 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams 3 Information Systems Analysis and Design CSC340 2001 Jaelson Castro and John Mylopoulos Information Systems Analysis and Design Initialization offerNewCourse set count 0 create CourseRoster addStudent count 10 count 10 Closed quarterStarted cancel cancel end state Lochovsky98 Cancelled 2001 Jaelson Castro and John Mylopoulos CSC340 States Course Lifetimes Open State and Activity Diagrams 4 delete CourseRoster State and Activity Diagrams 5 A state represents a time period during which A predicate is true e g budget expenses 0 An action is being performed e g check inventory for order items or Someone waits for an event to happen e g arrival of a missing order item A state can be on or off When a state is on all its outgoing transitions are eligible to fire For a transition to fire its event must occur and its condition must be true When a transition does fire its action is carried out States can have associated activities Special activity constructs include do stateDiagramName parameterLis t calls another state diagram entry action carry out the action when entering the activity exit action carry out the action when exiting 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams 6 Information Systems Analysis and Design CSC340 Information Systems Analysis and Design CSC340 Course Lifetimes Again Superstates Initialization do Initialize State transition diagrams can be very hard to read once they grow to more than a few dozen states For UML state diagrams states can be composed into nested states or superstates Such compositions make it possible to view a state diagram at different levels of abstraction A superstate consists of one or more states When an AND superstate is on all its states are also on When an OR superstate is on one of its states is on addStudent count 0 CourseRoster Create addStudent count 10 Open entry RegisterStudent exit CourseRoster AddStudent student count 10 cancel cancel Cancelled Closed do FinalizeCourse CourseRoster Delete quarterStarted 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams 7 Information Systems Analysis and Design CSC340 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams 8 Information Systems Analysis and Design CSC340 More on Transmission An OR Superstate Transmission Transmission select R Neutral select R Neutral select N select F select N select N Reverse select N Reverse select F Forward upshift stop Forward First downshift 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams 9 Information Systems Analysis and Design CSC340 upshift Second Third downshift 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams 10 Information Systems Analysis and Design CSC340 State Diagram for Purchase Order Order An AND Superstate get order Checking all items in stock Checking Dispatching Do package items Do check items Cancelled Waiting Item received some item not In stock Dispatching some item not In stock Item received all items in stock Waiting deliver package Delivered Authorizing Authorized cancel OR Superstate Rejected 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams 11 Cancelled 2001 Jaelson Castro and John Mylopoulos Delivered State and Activity Diagrams 12 Information Systems Analysis and Design CSC340 Information Systems Analysis and Design CSC340 Auto Transmission Bridge Vulnerability Rules Ignition Playing Bridge Rubber N S vulnerability Off turn key to start Transmission in Neutral release key Starting On turn key off Not vulnerable N S game Vulnerable N S game turn key off N S wins Transmission select R Neutral select N Not vulnerable E W game Vulnerable E W game Reverse select N select F E W vulnerability Forward E W wins stop upshift First upshift Second downshift 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams 13 Information Systems Analysis and Design CSC340 2001 Jaelson Castro and John Mylopoulos CSC340 Firing a Transition Activity diagrams describe activities which involve concurrency and synchronization Activity diagrams are a variation of state diagrams that focuses on the flow of actions and events Can be used To model a human task a business process for instance To describe a system function that is represented by a use case In operation specifications to describe the logic of an operation Activity diagrams use a Perti net like notation to describe activities which involve concurrency and synchronization Petri nets use transitions which involve
View Full Document
Unlocking...