20.7. Defining the Sale--makeLineItem Method

As a final example, the makeLineItem method of class Sale can also be written by inspecting the enterItem collaboration diagram. An abridged version of the interaction diagram, with the accompanying Java method, is shown in Figure 20.10.

Figure 20.10. Sale--makeLineItem method.

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.