VisibilityKind

VisibilityKind is an enumeration type that defines literals to determine the visibility of elements in a model.

Description
VisibilityKind is an enumeration of the following literal values:
· public
· private

Additional Operations

  1. The query bestVisibility() examines a set of VisibilityKinds, and returns public as the preferred visibility.

    VisibilityKind::bestVisibility(vis: Set(VisibilityKind)) : VisibilityKind;
    bestVisibility = if vis->includes(#public) then #public else #private endif

Semantics
VisibilityKind is intended for use in the specification of visibility in conjunction with, for example, the Imports,
Generalizations and Packages packages. Detailed semantics are specified with those mechanisms. If the Visibility package
is used without those packages, these literals will have different meanings, or no meanings.
· A public element is visible to all elements that can access the contents of the namespace that owns it.
· A private element is only visible inside the namespace that owns it.
In circumstances where a named element ends up with multiple visibilities, for example by being imported multiple times,
public visibility overrides private visibility, i.e., if an element is imported twice into the same namespace, once using
public import and once using private import, it will be public.