13.5. DiscussionenterItem Postconditions

The following section dissects the motivation for the postconditions of the enterItem system operation.

Instance Creation and Deletion

After the itemID and quantity of an item have been entered, what new object should have been created? A SalesLineItem. Thus:

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

Note the naming of the instance. This name will simplify references to the new instance in other post-condition statements.

Attribute Modification

After the itemID and quantity of an item have been entered by the cashier, what attributes of new or existing objects should have been modified? The quantity of the SalesLineItem should have become equal to the quantity parameter. Thus:

  • sli.quantity ...

Get Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.