Professional Documents
Culture Documents
Package Diagram
“Package diagram is a UML structure diagram which shows packages and
dependencies between the packages.”
Visibility:
Owned and imported elements may have a visibility that determines whether they
are available outside the package.
If an element that is owned by a package has visibility, it could be
only public or private visibility.
Protected or package visibility is not allowed.
The visibility of a package element may be indicated by preceding the name of the
element by a visibility symbol ("+" for public and "-" for private).
Package Diagram
Element Import:
Element import is a directed relationship between an importing namespace and
imported packageable element.
It allows the element to be referenced using its name without a qualifier. An element
import is used to selectively import individual elements.
Package Import:
Package import is a directed relationship between an importing namespace and
imported package, that allows the use of unqualified names to refer to the package
members from the other namespace(s).
Package Diagram
Import and Access: The visibility of a package import could be either public or
private.
If the package import is public, the imported elements will be added to the
namespace and made visible outside the namespace, while if it is private they will
still be added to the namespace but without being visible outside.
A keyword is shown near the dashed arrow to identify which kind of package import
is intended. The predefined keywords are «import» for a public package import,
and «access» for a private package import. By default, the value of visibility is public.
Package Diagram
Package Merge:
A package merge is a directed relationship between two packages that indicates
that content of one package is extended by the contents of another package.
Essentially, the contents of two packages are combined to produce a new package.
Package Diagram
Common Uses:
Modeling Groups of Elements
The most common purpose for which you'll use packages is to organize modeling
elements into groups that you can name and manipulate as a set.
If you are developing a trivial application, you won't need packages at all. All your
abstractions will fit nicely into one package. For every other system, however, you'll
find that many of your system's classes, interfaces, components, and nodes tend to
naturally fall into groups. You model these groups as packages.
Package Diagram
Common Uses:
Modeling Architectural Views
Packages can be used to model the different views of software systems architecture
where view is a projection into the organization and structure of a system, focused
on a particular aspect of that system. We can decompose a system into almost
orthogonal packages, each of which addresses a set of architecturally significant
decisions.