UML Package Diagrams: Diagramming Guidelines
- Depict a high-level overview of your requirements (overviewing a collection of UML Use Case diagrams)
- Depict a high-level overview of your architecture/design (overviewing a collection of UML Class diagrams).
- To logically modularize a complex diagram.
- To organize Java source code.
There are guidelines for:
1. Class Package Diagrams
Figure 1. A class package diagram.

- Create UML Component Diagrams to Physically Organize Your Design.
- Place Subpackages Below Parent Packages.
- Vertically Layer Class Package Diagrams.
- Create Class Package Diagrams to Logically Organize Your Design. Figure 1depicts a UML Class diagram organized into packages. In addition to the package guidelines presented below, apply the following heuristics to organize UML Class diagrams into package diagrams:
- Place the classes of a framework in the same package.
- Classes in the same inheritance hierarchy typically belong in the same package.
- Classes related to one another via aggregation or composition often belong in the same package.
- Classes that collaborate with each other a lot, information that is reflected by your UML Sequence diagrams and UML Collaboration diagrams, often belong in the same package.
2. Use Case Package Diagrams
Use cases are often a primary requirement artifact in object-oriented development methodologies, this is particularly true of instantiations of the Unified Process, and for larger initiatives package diagrams are often created to organize these usage requirements.
Figure 2. A UML Use Case diagram comprised mostly of packages.

- Create Use Case Package Diagrams to Organize Your Requirements
- Include Actors on Use Case Package Diagrams
- Horizontally Arrange Use Case Package Diagrams
3. Packages
The advice presented in this section is applicable to the application of packages on any UML diagram, not just package diagrams.
- Give Packages Simple, Descriptive Names
- Apply Packages to Simplify Diagrams
- Packages Should be Cohesive
- Indicate Architectural Layers With Stereotypes on Packages
- Avoid Cyclic Dependencies Between Packages
- Package Dependencies Should Reflect Internal Relationships