UML Package Notation

Basic Package Notation

Packages represents a basic contaier of items. In OO-design packages typically contain classes and are thus part of the class diagrams.

At an architectural level of abstraction the detailed contens of each package is often not shown or just a selection of important/typcial classes are shown. At this level of abstraction packages often have dependencies indicating that the implementation in a package depends on the implementation in another package. Thus basic structures can be created.

Packages are often implemented as packages (Java etc), namespaces, modules or subsystems.

UML

Basic package notation, shows the name of the package either in the body or in the tab. Dependency is used to indicate that the implementation in First Package can depend on the implementation in Second Package

UML Design Packages

Nesting

Nesting packages and classes in packages can be done in three ways, the meaning is the same in all three cases.

Placing contents inside the package Placing contents inside the package

Using the containment relation UML Pakcages with Containment Relation

Using fully qualified names - this can be useful if a tool does not support packaes and/or in diagrams where you want to show package information but it is not suitable from a diagram perspective, e.g. object and sequence diagrams. UML Packages with Fully Qualified Names