DOC PREVIEW
Toronto CSC 340 - State and Activity Diagrams

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Information Systems Analysis and Design CSC340© 2002 Jaelson Castro and John Mylopoulos Statechart Diagrams -- 1IV. State and Activity DiagramsIV. State and Activity DiagramsState DiagramsEvents and StatesSuperstatesActivity DiagramsPetri NetsInformation Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 2State Diagrams (Statecharts)State Diagrams (Statecharts) These are state transition diagrams (with some interestingadditions) which can be used to describe the operatingenvironment of the system, interactions of the system with thatenvironment, also the lifetime of some object (a person, astudent,…) within or without the system. Transitions are supposed to represent actions which occur“quickly” and are not interruptible. A transition can have anassociated triple Event[Condition]/Actionall parts of this triple are optional. States are supposed to represent longer-running activities (orother things). What constitutes “quickly” and “longer-running”depends on the application.2Information Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 3State Diagram for Purchase OrderState Diagram for Purchase Order/get orderCheckingDo/check itemsDispatchingDo/package items[some item notIn stock]WaitingItem received[some item notIn stock]Item received[all items in stock][all items in stock]/deliver packagestarteventconditionactionInformation Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 4EventsEvents An event is a happening that the system needs to know about. For example, completing an assignment, failing an exam, or asystem crash are all events. An event may trigger an action by an actor or the system beingdeveloped. 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 byan object or actor;Time events mark the passage of a designated period oftime, e.g., after(10 seconds)3Information Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 5Course LifetimesCourse LifetimesInitializationOpenClosedCancelledofferNewCourse/set count=0;create(CourseRoster)[count=10] addStudent[count<10]cancelcancel/delete(CourseRoster)quarterStarted[Lochovsky98]end stateInformation Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 6StatesStates 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 missingorder item. A state can be “on” or “off”. When a state is “on”, all its outgoing transitions are eligible to fire. Fora 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 constructsinclude: do/stateDiagramName(parameterList ) -- “calls” another statediagram; entry/action -- carry out the action when entering the activity; exit/action -- carry out the action when exiting;4Information Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 7addStudent/count=0;CourseRoster.Create()[count=10]addStudent[count<10]cancelcancelCourseRoster.Delete()quarterStartedCloseddo/FinalizeCourseCancelledentry/RegisterStudentexit/CourseRoster.AddStudent(student)OpenInitializationdo / InitializeCourse Lifetimes, AgainCourse Lifetimes, AgainInformation Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 8 State transition diagrams can be very hard to read once theygrow to more than a few dozen states. For UML state diagrams, states can be composed into nestedstates, or superstates. Such compositions make it possible toview 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”.SuperstatesSuperstates5Information Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 9An OR SuperstateAn OR SuperstateNeutralForwardReverseTransmissionselect Rselect Nselect Fselect NInformation Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 10Neutral ReverseTransmissionselect Rselect Nselect Fselect NSecondFirst ThirdForwardupshiftupshiftdownshiftdownshiftstop……More on More on TransmissionTransmission6Information Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 11CancelledDeliveredRejectedCheckingWaitingDispatchingAuthorizingAuthorizedAn AND SuperstateAn AND SuperstateInformation Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 12State Diagram for Purchase OrderState Diagram for Purchase Order/get orderCheckingDo/check itemsDispatchingDo/package items[some item notIn stock]WaitingItem received[some item notIn stock]Item received[all items in stock][all items in stock]Delivered/deliver packageCancelled/cancelORSuperstate7Information Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 13Bridge Vulnerability RulesBridge Vulnerability RulesPlaying Bridge RubberN-S gameNotvulnerableVulnerable N-S winsN-S vulnerabilityN-S gameE-W gameNotvulnerableVulnerable E-W winsE-W vulnerabilityE-W gameInformation Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams -- 14Auto TransmissionAuto TransmissionNeutral ReverseTransmissionselect Rselect Nselect Fselect NSecondFirst ThirdForwardupshift upshiftdownshiftdownshiftstopStarting OnIgnitionOffturn key to start[Transmissionin Neutral]releasekeyturn key offturn key off8Information Systems Analysis and Design CSC340© 2001 Jaelson Castro and John Mylopoulos State and Activity Diagrams --


View Full Document

Toronto CSC 340 - State and Activity Diagrams

Documents in this Course
Scoping

Scoping

10 pages

Load more
Download State and Activity Diagrams
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view State and Activity Diagrams and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view State and Activity Diagrams 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?