19.1. Visibility Between Objects
The designs created for the system operations (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 receiverthe sender must have some kind of reference or pointer to the receiver object.For example, the getProductDescription message sent from a Register to a ProductCatalog implies that the ProductCatalog instance is visible to the Register instance, as shown in Figure 19.1.
Figure 19.1. Visibility from the Register to ProductCatalog is required.[1]
[1] In this and subsequent code examples, language simplifications may be made for the sake of brevity and clarity.
When creating a design of interacting objects, it is necessary to ensure that the necessary visibility is present to support message interaction.