UML Package Diagram Tutorial

A UML package diagram shows dependencies between the packages in the model. It depicts the structure and organization of project in the large scale.

Package Diagram in UML

A package diagram is a structure UML diagram. It depicts the main outline of a model using packages that are usually displayed in hierarchies. It also shows the dependencies between the packages.
Package Diagram in UML
Package Diagram in UML

Package Diagram Overview

UML Package Diagram Overview
UML Package Diagram Overview

Package Diagram Symbols

Software Ideas Modeler offers tools for following elements of a package diagram:

  • Package
  • Class
  • Import
  • Access
  • Refine
  • Merge
  • Use
  • Containment

Package

A package includes a group of elements and defines their namespace.

Package Merge

A package merge incorporates a package to another package. Multiple packages may be merged to a single package. The Merge relation points to a merged package from a package whose content is being merged. The merged package contains all the content from all packages which point to it.

Package Import

A package import allows the packaged objects to use classifiers from the imported package with unqualified names in the target package. The relation arrow from an imported package points to a target package.

Use

A use relationship shows which package is publicly used by a package. It is used for depicting the usage of interfaces.

Access

An access relationship shows which package is accessed by a package. It expresses private usage.

How to Draw a Package Diagram?

You can create a new package diagram in multiple ways:

  • Click on a Plus button in the tab switch bar, navigate to UML group and click on the UML Package Diagram item
  • Press CTRL+SHIFT+D, choose Package Diagram from the UML group, enter the name and click on the OK button.
  • Switch to Project tab in the ribbon and click on the Package Diagram item in the Content gallery.
  • Open Project sidebar, right-click on a project (or a folder) node, and in the Add Diagram submenu, choose UML Package Diagram.
Create a new UML use case diagram
Create a new UML use case diagram

How to Draw Package Diagram Elements?

How to Draw a Package?

  • Click on the Package button in the Package Diagram group in the toolbox.
  • Specify the bounds of the new package by dragging on the diagram canvas.
  • If you want to add a package with the default size, just click on a diagram canvas and the package will be inserted to the specified position.
  • If you want to insert multiple packages in a row, double click (or click twice) on the Package button in the toolbox and draw as many packages as you want in the diagram editor.

How to Draw a Package Merge?

  • Click on the Package Merge button in the Package Diagram group in the toolbox.
  • Drag from a package to another package where the first package should be merged in.
  • Another way you can insert a package merge relationship between two packages is to click on the Package Merge button in the toolbox and drag it in between two packages. The diagram editor shows you which two elements will be connected when you release the button.
  • If you want to insert multiple package merge relationships in a row, double click (or click twice) on the Package Merge button in the toolbox and draw the desired number of package merge relationships in the diagram editor.

How to Draw a Package Import?

  • Click on the Package Import button in the Package Diagram group in the toolbox.
  • Drag from a package to another package where the first package should be imported in.
  • Another way you can insert a package import relationship between two packages is to click on the Package Import button in the toolbox and drag it in between two packages. The diagram editor shows you which two elements will be connected when you release the button.
  • If you want to insert multiple package import relationships in a row, double click (or click twice) on the Package Import button in the toolbox and draw the desired number of package import relationships in the diagram editor.

How to Draw a Use?

  • Click on the Use button in the Package Diagram group in the toolbox.
  • Drag from a package to a publicly used package. The relationship points from a user to a usage.
  • Another way you can insert a use relationship between two packages is to click on the Use button in the toolbox and drag it in between two packages. The diagram editor shows you which two elements will be connected when you release the button.
  • If you want to insert multiple use relationships in a row, double click (or click twice) on the Use button in the toolbox and draw the desired number of use relationships in the diagram editor.

How to Draw an Access?

  • Click on the Access button in the Package Diagram group in the toolbox.
  • Drag from a package to a privately accessed package. The relationship points from an accessor to an accessed package.
  • Another way you can insert an access relationship between two packages is to click on the Access button in the toolbox and drag it in between two packages. The diagram editor shows you which two elements will be connected when you release the button.
  • If you want to insert multiple access relationships in a row, double click (or click twice) on the Access button in the toolbox and draw the desired number of access relationships in the diagram editor.

New Comment

Comment