UML Package Diagram with Enterprise Architect

What is a UML Package Diagram?

A UML Package Diagram is a powerful structural view that organizes related model items like classes, use cases, or even entire diagrams into packages, clearly mapping out how these packages depend on or extend one another. These diagrams play a key role in simplifying complex systems, making them easier to manage and understand. Tools like Sparx Systems Enterprise Architect make it easier to create and maintain UML package diagrams using the Package elements and their connectors directly from the Diagram Toolbox.

At its core, a package is a named namespace. Everything placed inside it must have unique names, and while a model element may be referenced from many packages, it can belong to exactly one home package. Packages themselves can nest inside one another, creating a clean, hierarchical structure ideal for modularization. This type of diagram package view is essential in both small-scale and enterprise-level modeling.

What Can You Do with a UML Package Diagram?

Using package diagram UML models, you can:

  • Clarify how your system is logically separated—by domain, layer, or feature.
  • Prevent name conflicts by working within well-defined namespaces.
  • Visualize dependencies like imports and extensions—such as a “Web UI” package importing from “Core Services,” or a “Customer” package extending functionality in a “User” package.

This makes UML package diagrams especially valuable when you’re dealing with large, complex models where clarity and maintainability are key. In addition, these diagrams help communicate your system’s structure to stakeholders, developers, and business analysts alike.

Ready to Start Modeling Smarter?

Get Sparx Systems Enterprise Architect and begin creating powerful UML package diagrams with ease. Buy EA Now!

Basic Elements and Relationships You Must Know

UML Package Diagram Elements

UML Element Type Icon in EA Toolbox Description
Package uml class element in ea toolbox Used to organize your project contents. When added onto a UML package diagram, it depicts the structure and relationships of your model.
Profile uml interface element in sparx ea toolbox Generates a Profile Package with the stereotype «profile», used to define new types of structure in a model.
Model datatype element in uml ea tool Generates a Model Package with the stereotype «model», representing the parent node in a model structure.

UML Package Diagram Relationships

UML Connector Type Icon in EA Toolbox Description
Nesting uml associate connector An alternative graphical notation for showing containment of elements. Reflects internal structure; contents can be displayed by enabling 'Package Contents' in diagram properties.
Package Merge uml generalization connector Shows that the contents of the target Package are merged into the source Package. Existing elements in the source may be expanded by those in the target.
Package Import uml compose connector Indicates that the source Package has access to elements from the target Package. The source's namespace is extended, while the target remains unaffected.
Profile Application uml compose connector Indicates that a Profile has been applied to a Package, influencing its modeling semantics.

UML Standard Profile Toolbox Icons

UML Connector Type Icon in EA Toolbox Stereotype Description
Framework uml associate connector «framework» Represents the parent node in a framework structure.
Metamodel uml generalization connector «metamodel» Represents the parent node in a metamodel structure.
Model Library uml compose connector «modelLibrary» Represents the parent node in a model library structure.
System Model uml compose connector «systemModel» Represents the parent node in a system model structure.

Need Hands-On Training?

Accelerate your team’s modeling skills with our expert-led UML and Sparx EA training programs.

Online Bookstore Example: UML Package Diagram in Enterprise Architect

The diagram below illustrates a simplified Online Bookstore system using a UML package diagram example in Enterprise Architect. Each package groups relevant elements based on functionality or concern:

  • The Domain Model contains core business entities like Order, Account, ShoppingBasket, and Stock Item.
  • The Process Model defines workflows such as Manage Customer Orders, Ship Order, and supporting structures like Shopping Basket and Book Catalogue.
  • The Business Rule Model holds reusable definitions and constraints around ordering logic and rule definitions.
  • The Opportunity Definition package captures early-phase business information like Stakeholders and Positioning.

To illustrate real-world relationships:

  • A «package import» connector links Process Model to Domain Model, showing that the process logic relies on domain concepts (e.g., reusing Order or Shopping Basket elements).
  • A «package merge» connector is used from Business Rule Model to Domain Model, indicating that the rule definitions enhance or extend the original domain elements. For example, if OrderStatus is already defined in the Domain Model, merging would add business constraints to it without duplicating its structure.
  • Another «package import» connector from Business Rule Model to Opportunity Definition shows how business constraints are influenced by early-stage business inputs like stakeholder expectations.
  • Optionally, a nesting connector can be used between Opportunity Definition and Process Model to reflect how business goals shape the process workflows.

This UML package diagram explanation demonstrates how diagrams can break down a complex system into understandable, structured views—connecting abstract rules, technical models, and business priorities within a single visual model.

How to Create UML Package Diagram Using Sparx EA

Follow these steps to create your own UML package diagram using Sparx Systems Enterprise Architect:

1. In the Project Browser, select the package where you want to create the diagram.

2. Click on the Add Diagram icon in the Project Browser, or go to Design > Diagram > Add Diagram from the ribbon menu.

3. In the Diagram Builder, click on the Perspective icon → select UML > Structural and choose Package Diagram.

4. EA will show the related toolbox automatically. If not, go to Start > All Windows > Design to enable the toolbox. 

5. From the toolbox, drag and drop elements like Package, Model Library, and Profiles onto the diagram. Add connectors (like Import, Merge, or Nesting) between them as required. 

6. To make the diagram clearer for documentation or presentations:

  • Right-click on the diagram background and select Properties.
  • Go to the Elements tab and check Package Contents under the “Show Compartments” section.

Have a Complex Modeling Challenge?

Let our EA consultants help you structure, optimize, and scale your modeling efforts with precision. Talk to an EA Consultant now!

Learn More