Docsity

Systems Building 2 Lecture 4a - developing a State chart, Lecture notes of Computers and Information technologies

Partial preview of the text

Download Systems Building 2 Lecture 4a - developing a State chart and more Lecture notes Computers and Information technologies in PDF only on Docsity!

System Building 2

Lecture 4

Developing State Charts

Direct entrants to year two

Read this on teachmat

on Teachmat you will find

 Last years work

 (^) (if not ask technicians QM360 or Ray Stoneham QM366)  (^) They will all disappear next Monday

 Recommended books

 (^) Slide 24 of lecture 01 recommended some books 

There are System Building Surgeries (in my office)

Tuesday 10am-12noon
 Wednesday, 9-11am and 3-5pm
 There are about 600 students doing SB or SA or LSSD

 (^) It is for solving problems clarifying points  (^) After all the normal channels have failed

I average 50 emails a day (100 including spam)

 some of which require 20 mins work in order to give a
satisfactory response (do the math!)
Do not email me unless it is essential

Review of State Charts

State charts depict:

 the dynamic aspects of events in the life of an object

any consequential changes on the state of an object

 Therefore

 (^) We model (an abstraction of) an object  (^) We model all states and or all events that could happen:  (^) in its whole life (usually) or  (^) in some well defined portion of its life  (^) We define what we are modelling

 falsehoods (we will not get it right first time, 2nd^3 rd…)

 We do not thoroughly understand the problem domain
 We will continually revise and correct as we understand more
 We may never understand it completely, just ‘good enough’.

Review of State Charts

States

 Dynamic (processing)
 Static (waiting until an event happens)
 Combined (processing until some event happens)
 Initial and Final states (pseudo-states)

Events

 Synchronous (often method calls)
 Asynchronous (usually signals)

Guarded by [ constraints ] (transition only happens if guard is true)

Transitions

Triggered (by events)
 Triggerless (by process termination)
 May have an associated / Action

State Charts example snippet

Ringing entry / ringcount = 0 exit / ringStop() do / ring() [ringcount<6] / ringcount += Connected entry / pickUpLine() exit / dropLine() do / answer() callWaiting(call) / call.defer() [ringcount = 6] / phone.setMode(autoAnswer) Handset picked up / phone.setMode(manualAnswer) Internal transition Name of state Entry, Exit & Internal actions Constraint (guard Condition) Triggerless transition Directed Arc (Transition) Separator Event Node (State) Open Arrows Introduces action Rounded Corners Solid lines Object Action (method) Constraint(constrained) event Parameter(s)

State Chart Events

 (^) Event  (^) Causes the triggering of a transition (between states)  (^) Synchronous (usually method calls)  (^) Triggerless transitions on termination (no event, just returns to callee)  (^) Can also have triggered events that cause termination (or a later continuation (history))  (^) The initiating call will be triggered (event) or triggerless (return from sub-process)  (^) Asynchronous  (^) Non-sequential  (^) Random timing  (^) Events are:-  (^) Signals/ flags  (^) Calls (to procedures)  (^) Action (atomic)  (^) Transitions (an action that triggers a change of state elsewhere)  (^) Timed …(see transition above)  (^) Depicted by (and composed of):-  (^) Trigger (name) with…  (^) parameters in round brackets if any  (^) Guard condition/constraint (in square braces) if any  (^) Action

Specify start and end of the

life in question (call it m:Mix)

 Starts when customer:

 (^) Selects first part of the mix?  (^) Selects last item and it all checks out ok?  (^) Initially Requests details?

 Ends when:

 (^) CD is burnt  (^) Customer pays and collects  (^) Never? Or if customer does not purchase?

 For this lecture let us assume the first and last

 (^) Starts as the first part is selected and ends iff the customer aborts the purchase  (^) Assume customer aborts if they do not return within 3 weeks  (^) ‘Request details’ is ignored (it happens prior to ‘select first item’)

 Assume no item is too large for blank media

 (^) (obviously unrealistic)

Find States (from specification, description, roleplay…)

(first select anything that looks as though it may affect the (state of the) mix)

Prior to life, Fairly irrelevant, Possibly related to a state
 A customer approaches the outlet and requests details about
a mix. The outlet staff provide promo material and a list of
available songs and videos. The customer makes a selection
gives it to the staff for checking. The staff check the availability
and run times to ascertain if it will fit on the media and give a
price. They also report on unused space (waste). This is
repeated until the customer is satisfied with the content and
places an order. The staff the ask for a title(s) and cover
graphic. The customer supplies their own graphic (JPEG) or
selects one from the outlets set. The staff indicate the
processing time (about 2 working hours) and when the
customer should return. The audio and or video staff,
download the content, prepare a blank CD/DVD and burn the
data onto it. The Graphic staff, prepare the art work and print
the labels and packaging. The sales staff, package the disks
artwork and promo material ready for the customer.
Most were actions not states
Few are directly related to the mix
Some are triggers others are guards

Makes a selection No Item Selected Some items Selected All items selected Checking (of selection) None checked Some checked All Checked Availability (of item) Available Unavailable Run times (individual) Will fit on the media Will not fit Exists unused space Give a price (individual) Unknown Known Give a price (Total items) Tot unknown Tot Known customer satisfied customer satisfied customer unsatisfied Places an order Order unplaced Order placed indicate the processing time download the content (Availability) Burn the data Un-burnt Burnt Prepare the packaging (assume you thought this obvious) available unavailable prepare the art work print the labels, packaging package customer ready Get graphic prerequisites (of mix) title(s) indicated/unindicated Graphic indicated/unindicated Supplies Selects Most are states of objects other than m:Mix We do not usually do opposite states

Review state selection

The colours relate to the following slide

Determine Triggers/Messages/Actions

The responsible objects

 and/or their class (The default is m or Mix)

Determine candidate states of mix

Identify obvious omissions

Determine States

That can always be meaningfully triggered  Their triggers