UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory UML Weekend Crash Course™ - To Parent Directory

crnarupa.singidunum.ac.rs
from crnarupa.singidunum.ac.rs More from this publisher
01.01.2015 Views

Session 15—Applying the Activity Diagram to the Case Study 163 Now you have all the pieces you need to do a bit of organizing. One opportunity to watch for is concurrency. Identify tasks that may be done at the same time because they don’t depend on one another. For example, Figure 15-6 shows that notifying accounts payable and updating inventory don’t overlap or depend on one another so they can be modeled as concurrent activities. Use the fork bar to show that you want to follow both logical paths at the same time. Use the synchronization bar to show that you’re done with the concurrent tasks and want to continue on a single logical path. In this example, after all the updates and notifications are done, you can print the confirmation. Notify Accounts Payable of the updated Purchase Order Update inventory for the Products received Display the "Accounts Payable notified" message Display "inventory updated successfully" message Print the receiving confirmation done Figure 15-6 Modeling the concurrency opportunity Figure 15-7 puts all the segments together. Notice in the bottom left below the activity labeled “Display “invalid item” error message” I added another merge point to bring together the segments from Figures 15-4 and 15-5.

164 Saturday Afternoon start (merge point) proceed or cancel [cancel] [proceed] cancelled Enter Shipper_ID Prompt to reenter or cancel [Shipper not found] Find Shipper Display Shipper Details [Shipper found] More products to receive [no] [P.O. not found] [yes] Display "invalid P.O." error message Display "invalid item" error message [no match] (merge point) Find the Purchase Order for the product [P.O. found] Match the product to an item on the Purchase Order Check off the item and quantity on the Purchase Order [match found] Notify Accounts Payable of the updated Purchase Order Display the "Accounts Payable notified" message Update inventory for the Products received Display "inventory updated successfully" message Set the item aside (merge point) Print the receiving confirmation done Figure 15-7 The complete Activity diagram As you can see from the example, all the old flowchart elements are still there. UML has added concurrency to keep pace with technology. REVIEW Often, text can be a bit too ambiguous for defining a complex process. The Activity diagram offers a visual alternative that also supports common programming constructs. As such, it bridges the gap nicely between user requirements and programming requirements. To translate the user description into an Activity diagram, isolate each task as an activity. Indicate the sequence of the tasks by drawing the transition arrow from one activity to the next activity in the sequence.

164<br />

Saturday Afternoon<br />

start<br />

(merge point)<br />

proceed or cancel<br />

[cancel]<br />

[proceed]<br />

cancelled<br />

Enter<br />

Shipper_ID<br />

Prompt to reenter<br />

or cancel<br />

[Shipper not found]<br />

Find Shipper<br />

Display<br />

Shipper<br />

Details<br />

[Shipper found]<br />

More products to receive<br />

[no]<br />

[P.O. not found]<br />

[yes]<br />

Display "invalid<br />

P.O." error<br />

message<br />

Display "invalid<br />

item" error<br />

message<br />

[no match]<br />

(merge point)<br />

Find the<br />

Purchase Order<br />

for the product<br />

[P.O. found]<br />

Match the product<br />

to an item on the<br />

Purchase Order<br />

Check off the item<br />

and quantity on<br />

the Purchase Order<br />

[match found]<br />

Notify Accounts<br />

Payable of the<br />

updated<br />

Purchase Order<br />

Display the<br />

"Accounts<br />

Payable notified"<br />

message<br />

Update<br />

inventory for<br />

the Products<br />

received<br />

Display "inventory<br />

updated<br />

successfully"<br />

message<br />

Set the item<br />

aside<br />

(merge point)<br />

Print the<br />

receiving<br />

confirmation<br />

done<br />

Figure 15-7 The complete Activity diagram<br />

As you can see from the example, all the old flowchart elements are still there. <strong>UML</strong> has<br />

added concurrency to keep pace with technology.<br />

REVIEW<br />

Often, text can be a bit too ambiguous for defining a complex process. The Activity diagram<br />

offers a visual alternative that also supports common programming constructs. As such, it<br />

bridges the gap nicely between user requirements and programming requirements.<br />

<strong>To</strong> translate the user description into an Activity diagram, isolate each task as an<br />

activity. Indicate the sequence of the tasks by drawing the transition arrow from<br />

one activity to the next activity in the sequence.

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

Saved successfully!

Ooh no, something went wrong!