UML Package Diagrams Reference

Notation Description
Package
image.pngReference - 图2
Package org.hibernate
Package is a namespace used to group together elements that are semantically related and might change together.
A package could be shown as a rectangle with a small tab attached to the left side of the top of the rectangle.
Reference - 图3
Package org.hibernate contains SessionFactory and Session.
Members of the package may be shown within the boundaries of the package. In this case the name of the package should be placed on the tab.

| | Reference - 图4
Package org.hibernate contains interfaces SessionFactory and Session. | Members of the package may be shown outside of the package by branching lines from the package to the members. A plus sign (+) within a circle is drawn at the end attached to the namespace (package).
This notation for packages is semantically equivalent to composition (which is shown using solid diamond.) | | Reference - 图5
All elements of Library Domain package are public except for Account. | 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 URI Attribute | | | Reference - 图6
EJB Profile shown as a package with URI attribute. | Package has optional URI attribute which serves as unique identifier of the package. This attribute was introduced in UML 2.4 mostly to support exchange of profiles using XMI.
UML 2.4 requires this URI attribute to follow the rules and syntax of the IETF URI specification RFC 2396 (while the more recent version of the URI syntax RFC 3986 released in 2005 rendered the RFC 2396 obsolete).
The URI attribute of a package may be rendered in the form {uri=} after the package name. | | Element Import | | | Reference - 图7
Public import of PageInfo element into Search namespace from Domain package. | If element import is public, the imported element will be added to the namespace and made visible outside the namespace. Keyword «import» indicates public element import. | | Reference - 图8
Private import of SortInfo element into Search namespace from Domain package. | If element import is private, the imported element will be added to the namespace but will not be visible outside the namespace. Keyword «access» indicates private element import. | | Package Import | | | Reference - 图9
WebApplication imports Presentation package with default public visibility. | Package import
is shown using a dashed arrow with an open arrowhead from the importing namespace to the imported package. By default, the value of visibility is public, so it is the same as «import». | | Reference - 图10
Public import of Domain package into WebApplication. | If the package import is public, the imported elements will be added to the namespace and made visible outside the namespace. Keyword «import» indicates public package import. | | Reference - 图11image.png
Private import of Presentation package into WebApplication. | If the package import is private, the imported elements will be added to the namespace but will not be visible outside the namespace. Keyword «access» indicates private package import. | | Package Merge | | | Reference - 图13
UML Kernel package merges Constructs package which imports Primitive Types. | 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.
Package merge is shown using a dashed line with an open arrowhead pointing from the receiving package to the merged package. Keyword «merge» is shown near the dashed line. | | Model | | | Reference - 图14
Business layer model | Model is a package which captures a view of a system. View is some abstraction of the system describing only those aspects of the system that are relevant to the purpose of the model, at the appropriate level of detail, describing logical or behavioral aspects of the system to a certain category of readers.
Model is notated using the ordinary package symbol (a folder icon) with a small triangle in the upper right corner of the large rectangle. | | Reference - 图15
Service Layer model contains service interfaces and message types | If contents of the model are shown within the large rectangle, the triangle may be drawn to the right of the model name in the tab. | | Reference - 图16
Stereotyped model Layered Service | Model could be notated as a package with the keyword «model» placed above the name of the model. |

Reference - 图17 Examples of package diagrams

https://www.uml-diagrams.org/package-diagrams-reference.html