01.01.2015 Views

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Session 20—Modeling the Dynamic View: The Statechart Diagram 209<br />

Prospect<br />

order placed/ addOrder(Order)<br />

Active<br />

[payment past due]/<br />

setProbation(true)<br />

On Probation<br />

[6 months' orders > $10,000]/setPreferred(true)<br />

[payment past due > 1]/setPreferred(false)<br />

Preferred<br />

Figure 20-11 Adding the fourth transition<br />

This Statechart did not have a final state because within the scope of the problem statement<br />

there is no time when a customer object can no longer change. “On Probation” might<br />

be a final state because there are no arrows coming out of it, but this happened only<br />

because of the limited size of the example.<br />

There is one more very important observation about events on a Statechart diagram. The<br />

absence of an event is almost as informative as the presence of an event. In Figure 20-11,<br />

the only events that cause a Customer to change from the active state are the conditions<br />

6 months’ orders > $10,000, and payment past due. Even though you modeled the event<br />

order placed in another location, it has no effect when it happens to the Customer while he<br />

is in the active state. It simply is not recognized by the active state. You know this because<br />

there is no arrow leaving the active state in response to the order placed event. So the diagram<br />

reveals both the events that an object will respond to while in a state and the events<br />

it will not respond to.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!