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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Prospect<br />

order placed/<br />

Active<br />

Figure 20-7 The transition from Prospect to Active<br />

Now examine the event and determine what, if any, corresponding action needs to occur.<br />

Figure 20-8 shows the action addOrder(Order). This operation associates the newly placed<br />

order with the customer. According to the client’s rules, this makes him an active customer.<br />

Prospect<br />

order placed/ addOrder(Order)<br />

Active<br />

Figure 20-8 Associating an action with an event<br />

The second event, payment past due, triggers the transition to On Probation. Figure 20-9<br />

illustrates the new state, the event, the transition from active to on probation, and the<br />

action that actually makes the change to the object, setProbation(True).<br />

Prospect<br />

order placed/ addOrder(Order)<br />

Active<br />

[payment past due]/<br />

setProbation(true)<br />

On Probation<br />

Figure 20-9<br />

Adding the second transition

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

Saved successfully!

Ooh no, something went wrong!