Package Relationships (Import, Access, Merge, Use)
Explanation
Section titled “Explanation”Package relationships show how one package depends on or builds on another. They appear on a package diagram (see the article Package Diagram). Every relationship has a direction.
Import. A package import runs from an importing namespace to a package. A namespace is a container that holds named elements. In the PTC modeler profile, an import means one item imports another with public visibility.
Merge. A package merge runs between two packages. It says their contents are to be combined. In the PTC modeler profile, you create a merge on a package diagram. It shows that one package merges the content of another.
Matching rule. When two packages merge, elements with the same name and the same metatype are merged. A metatype is the kind of model element.
Label every relationship. A dependency between two packages with no label is read as a package import. A reader may take a plain arrow as an import even if you meant something else. Naming the relationship type removes the guess.
An open question. One issue raised against the UML standard asked whether elements imported into a package are merged too. The specification was unclear on this. Do not assume an answer. If it matters, state your intent in the text next to the diagram.
Example
Section titled “Example”A team models a shop with two packages, “Catalog” and “Ordering”. Ordering needs elements from Catalog. The diagram draws an arrow from Ordering to Catalog and labels it “import”. Later the team has two packages that both hold a “Cart Item” element of the same kind. They draw a merge between the packages and label it “merge”. The two Cart Item elements are then combined.
Trade-offs
Section titled “Trade-offs”Skipping labels saves effort, but readers will see an import where you may have meant something else. Merge combines contents, which can help, but the standard was unclear about imported elements. Explicit labels and a short note cost little and prevent misreading.
Checks
Section titled “Checks”- Every dependency between packages carries an explicit label for its relationship type.
- Each merge connects two packages and its intent (combining their contents) is clear to the reader.
- Where imported elements and a merge interact, the document states what is intended.
Related
Section titled “Related”- Package Diagram
- Package Diagram Modeling Mistake
- Differences between Class, Component and Package Diagrams
- UML Modeling Best Practice
- Coupling and Cohesion
Sources
Section titled “Sources”- Package diagram - Wikipedia — en.wikipedia.org, accessed 2026-11-09
- Import (UML Standard profile) — support.ptc.com, accessed 2026-11-09
- Package merge (UML Standard profile) — support.ptc.com, accessed 2026-11-09
- UML 2.6 RTF — Open Issues - OMG Issue Tracker — issues.omg.org, accessed 2026-11-09