OOSE_Week 09- Statechart Diagram

10
State Charts for detailed modeling Larman, chapter 29 Object-Orie nted Software Enginee ring

Transcript of OOSE_Week 09- Statechart Diagram

8/15/2019 OOSE_Week 09- Statechart Diagram

http://slidepdf.com/reader/full/ooseweek-09-statechart-diagram 1/10

State Chartsfor detailed modeling

Larman, chapter 29

Object-Oriented Software Engineering

8/15/2019 OOSE_Week 09- Statechart Diagram

http://slidepdf.com/reader/full/ooseweek-09-statechart-diagram 2/10

Introduction to State

Diagrams Interaction diagrams are very good for communication between cients and designers

between designers and other designers

between designers and impementors

!ut they are not part of the constructive core "onstructive core means that part from which an actua impementation

coud be generated

#he constructive core of the $%L is cass diagrams &for the static part'

state diagrams &for the dynamic part' State diagrams can describe very compe( dynamic behavior 

8/15/2019 OOSE_Week 09- Statechart Diagram

http://slidepdf.com/reader/full/ooseweek-09-statechart-diagram 3/10

State chart Diagrams

initial Statestate

transition

event

A State chart diagram shows the lifecycle of an object

• A  state is a condition of an object for a particular time

• An event  causes a transition from one state to another state

• Here is a State chart for a Phone Line object:

8/15/2019 OOSE_Week 09- Statechart Diagram

http://slidepdf.com/reader/full/ooseweek-09-statechart-diagram 4/10

State charts in UML:States in ovals, Transitions as arrows

  #ransitions abes have three

optiona parts)Event [Guard] / Action Find one of each

Item Received is an event, /get first item is an action,[Not all items checked] is aguard

State may aso abe activities,

e*g*, do/check item

8/15/2019 OOSE_Week 09- Statechart Diagram

http://slidepdf.com/reader/full/ooseweek-09-statechart-diagram 5/10

Superstates (nested states E(ampe shows a

super-state ofthree states

+hen one state iscompe(, you canincude sub-statesin it* drawn as

nestedrounded

rectangeswithin thearger state

8/15/2019 OOSE_Week 09- Statechart Diagram

http://slidepdf.com/reader/full/ooseweek-09-statechart-diagram 6/10

Concurrenc! in state diagrams ashed ine indicates that an order is in two different

states, e*g* "hecing . /uthori0ing +hen order eaves concurrent states, it1s in a singe

state) "anceed, eivered or ejected

8/15/2019 OOSE_Week 09- Statechart Diagram

http://slidepdf.com/reader/full/ooseweek-09-statechart-diagram 7/10

State Diagram for Seminar

"egistration /dd3articipant 4 Set count 5 6

cance seminar 

event  action, taken during transition

Setup

do4initiai0e seminar 

 /vaiabe

do4initiai0e seminar 

7u

do4finai0e seminar 

8 count 5 26 9

guard 

"anceed

do4refund payments

cance seminar 

multiple

exits

cance

seminar 

aktivity, carried out 

while in that state

8/15/2019 OOSE_Week 09- Statechart Diagram

http://slidepdf.com/reader/full/ooseweek-09-statechart-diagram 8/10

#$ercise % & Claims  / third party caim arises from an incident that has occurred* #he

caim must be reported to the caims office within the statutory

period to be vaid* +hen the caim is reported, the incident is

preferaby verified by a member of staff who was present at the

time* #he caim is recorded and evauated* If it is a trivia caim,

the caims assessor checs the caimant for previous caims and,

if there are no or : previous caims then a payment is made andthe caim is setted* If there are previous caims, the caimant wi

be referred to the courts* %ore serious caims may await e(pert

evidence and severa different court hearings* /t any stage, the

caim may be dropped, or a payment made without admitting

iabiity* If the caimant is a minor, the caim must remain on the

boos unti the caimant is over 2:* If a caim is setted by a court,

it may be appeaed* uring this time, the caim remains open*

raw a state diagram for a caim*

8/15/2019 OOSE_Week 09- Statechart Diagram

http://slidepdf.com/reader/full/ooseweek-09-statechart-diagram 9/10

"aim reported and

 /ccident veri fied

"aim reported

accident not verified

"aim rejected

 /wai ting e(pert

report

"aim reported

eject

efer to e(pert

3assed on to

underwriter 

Setted

efer to underwriter 

 /ccident veri fied

eete"aim#ime3assed$ndisputed

Settementisputed

"aim

ropped

#ime3assed$ndisputed

eport submitted

Solution

8/15/2019 OOSE_Week 09- Statechart Diagram

http://slidepdf.com/reader/full/ooseweek-09-statechart-diagram 10/10