Package Diagram icon Package Diagram
   

Package models describe the hierarchical organization of model elements. Package diagrams can show package containment in several ways, as indicated on this diagram.

Packages are generic mechanisms for grouping elements into semantically related groups and do not necessarily have a representation in implementation (except perhaps to represent a directory).

A package owns model elements (classes and other packages) meaning that the element is declared in the package and if the package is destroyed, the element is destroyed. A package provides a namespace and is an important mechanism for dealing with scale. Without packages, you would end up with large, flat models where all elements would be uniquely named.

Models can have hundreds, even thousands, of model elements. The sheer number of these elements can quickly become overwhelming. It's critical to group model elements into logical collections to keep the model manageable and readable.

Packages are useful as a unit of configuration management and help you control the elements that compose your system as they evolve at different rates over time.

A Package Diagram example for a Reservation system