O'Reilly logo

Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, Second Edition by Craig Larman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

17.5. Object Design: enterItem

The enterItem system operation occurs when a cashier enters the itemID and (optionally) the quantity of something to be purchased. Here is the complete contract:

Contract CO2: enterItem

Operation:enterItem(itemID : ItemID, quantity : integer)
Cross References:

Use Cases: Process Sale

Preconditions:There is an underway sale.
Postconditions:

- A SalesLineItem instance sli was created (instance creation).

- sli was associated with the current Sale (association formed).

- sli.quantity became quantity (attribute modification).

- sli was associated with a ProductSpecification, based on itemID match (association formed).

An interaction diagram will be constructed to satisfy the postconditions of enterItem, using the GRASP patterns ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required