12.8. Multiplicity From SalesLineItem to Item

It is possible for a cashier to receive a group of like items (for example, six tofu packages), enter the itemID once, and then enter a quantity (for example, six). Consequently, an individual SalesLineItem can be associated with more than one instance of an item.

The quantity that is entered by the cashier may be recorded as an attribute of the SalesLineItem (Figure 12.8). However, the quantity can be calculated from the actual multiplicity value of the relationship, so it may be characterized as a derived attribute—one that may be derived from other information. In the UML, a derived attribute is indicated with a “/” symbol.

Figure 12.8. Recording the quantity of items sold in a line item.

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.