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 22—Modeling the Extended Features of the Statechart 229<br />

Placed<br />

On entry/issueConf()<br />

cancel(datetime)<br />

Cancelled<br />

Figure 22-2<br />

Call event “cancel(datetime)”<br />

Time event<br />

A time event evaluates the passage of time as a trigger. It implies that the object supports<br />

some mechanism to monitor the passage of time. This might be implemented in a number of<br />

ways. The mechanism could be a batch program that runs at intervals to update a time<br />

attribute. The event could use a polling type of implementation where the object constantly<br />

checks to see what time it is.<br />

Use the keyword after to specify the time increment to be evaluated. For example, while<br />

the Order is in the packaged state, it is waiting to be shipped. But if it has not been<br />

shipped within three days, the priority needs to be increased to ensure that it leaves in a<br />

timely manner. Figure 22-3 models an internal event within the packaged state called “after<br />

3 days.” This implies that there will be code within the object that watches the passage of<br />

time to know when to initiate the action “upgrade ShippingPriority().”<br />

Packaged<br />

after 3 days/upgradeShippingPriority()<br />

Figure 22-3<br />

Time event “after 3 days”<br />

Change event<br />

A change event tests for a change in the object or a point in time. Use the keyword when<br />

with the required test. For example, you might need to know when to run a reporting job or<br />

cut invoices so you might say “when 12:00 AM the last day of the month.” Or you might<br />

watch for a specific condition such as a change in temperature. Then you might say, “when<br />

temp > 75 degrees.”

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

Saved successfully!

Ooh no, something went wrong!