Skip to end of metadata
Go to start of metadata

Visibility can be used to constrain the usage of a UML element. It can be set for specific elements in class diagrams, package diagrams and use case diagrams. Allowed values are:


Name

Short form

Meaning

Public

+

The element is visible to all elements that can access the contents of the element that owns it. This is the default option.

Private

-

The element is only visible inside the element that owns it.

Protected

#

The element is visible to elements that have a generalization relationship to the element that owns it.

Package

~

The element is owned by an element that is not a package and is visible to elements that are in the same package as its owning element. Any element marked as having package visibility is visible to all elements within the nearest enclosing package (given that other owning elements have proper visibility). Outside the nearest enclosing package, an element marked as having package visibility is not visible.

Setting the visibility via the element properties

  1. In the diagram, click the element, and then click  to open the properties window.

    In the case of an attribute, operation, or extension point, the window is directly opened after clicking the element.

  2. In visibility, click , and select the desired value. Which values are available depends on the type of element.



  3. Close the properties window.

Setting the visibility via the visibility control

Alternatively, the visibility of an attribute or operation can be set by clicking the plus sign in front of the attribute or operation name. Repeatedly clicking it changes the visibility to private (-), protected (#), package (~), and back to public (+).