18.1. Visibility Between Objects

The designs created for the system events (enterItem, and so on) illustrate messages between objects. For a sender object to send a message to a receiver object, the sender must be visible to the receiver—the sender must have some kind of reference or pointer to the receiver object.

For example, the getSpecification message sent from a Register to a ProductCatalog implies that the ProductCatalog instance is visible to the Register instance, as shown in Figure 18.1.

Figure 18.1. Visibility from the Register to ProductCatalog is required.[1]

[1] In this and subsequent code examples, language simplifications may be ...

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.