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 13—Modeling the Static View: The Object Diagram 143<br />

0..*<br />

VendorProduct<br />

0..1<br />

Shipment<br />

0..1<br />

CustomProduct<br />

Figure 13-4 Initial Class diagram modeling products<br />

Figure 13-4 tells you that each Shipment may have zero or more VendorProducts and zero<br />

or more CustomProducts. Each type of Product may or may not have been shipped.<br />

The rest of this session steps through the construction of an Object diagram that models<br />

the set of test cases for the Product Class diagram in Figure 13-4. The construction process<br />

demonstrates the model elements of the Object diagram and how the Object diagram illustrates<br />

test cases.<br />

I’m going to go through this one step at a time. You may spot more problems with the<br />

original Class diagram than the current test case reveals. By the time I cover all the test<br />

cases, we should have found all the problems. If we don’t, just send me a nice letter with<br />

the corrections.<br />

Test case 1<br />

A CustomProduct is created by assembling VendorProducts. VendorProducts 28, 38, and 72<br />

create CustomProduct 425.<br />

Figure 13-5 shows how the Class diagram is changed to include the aggregation relationship<br />

between CustomProduct and VendorProduct.<br />

The change shows that a CustomProduct is created from one or more VendorProducts. But<br />

a VendorProduct doesn’t have to be used in a CustomProduct.<br />

Test case 2<br />

0..*<br />

What is the minimum number of objects that make up a CustomProduct configuration After<br />

reviewing all the test data, we find that a CustomProduct must consist of at least<br />

two VendorProducts. Otherwise, there is no way to distinguish a CustomProduct from a<br />

VendorProduct.

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

Saved successfully!

Ooh no, something went wrong!