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.

220<br />

Sunday Morning<br />

receive pmt<br />

Order is filled<br />

Filled<br />

Tentative<br />

Placed<br />

entry/issueConf()<br />

exit/CustomerStmt.issue()<br />

authorize override<br />

cancel<br />

Cancelled<br />

Figure 21-4 Modeling an action invoked on another object<br />

In the example in Figure 21-3, when the Order is cancelled, the Order is supposed to<br />

issue a customer statement. But the customer statement is another object that takes care of<br />

issuing itself. The Order just needs to tell it that it’s time to do so. All the actions modeled<br />

so far were actions on the same object. <strong>To</strong> show that the action is invoked on a different<br />

object, simply provide the object name followed by a period before the action expression.<br />

This is often referred to as the dot notation. See the exit action notation in Figure 21-4<br />

where the issue() action is now being sent to the CustomerStmt object.<br />

Order of Events<br />

With all these events, you could end up with a tangled mess of event actions, entry actions,<br />

exit actions, and activities. So how do you process all this behavior in a sane fashion When<br />

an event occurs, the order of execution runs like this:<br />

1. If an activity is in progress in the current state, interrupt it (gracefully if possible).<br />

2. Execute the exit: action(s).<br />

3. Execute the actions associated with the event that started it all.<br />

4. Execute the entry: action(s) of the new state.<br />

5. Execute the activity or activities of the new state.

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

Saved successfully!

Ooh no, something went wrong!