In common usage, visibility is the ability of an object to “see” or have a reference to another object. More generally, it is related to the issue of scope: Is one resource (such as an instance) within the scope of another? There are four common ways that visibility can be achieved from object A to object B:
Attribute visibility— B is an attribute of A.
Parameter visibility— B is a parameter of a method of A.
Local visibility— B is a (non-parameter) local object in a method of A.
Global visibility— B is in some way globally visible.
The motivation to consider visibility is this:
For an object A to send a message to an object B, B must be visible to A. |
For example, to create an interaction diagram in which a message is sent ...
No credit card required