Prev | Next |
Introducing Package Diagrams
The Package diagram is a simple diagram that visually describes the structure of the repository including relationships between Packages and other Packages and elements. Package diagrams appear quite simplistic with a small number of elements:
- Model
- Model Library
- Package
- View
- View Point
- Stakeholder
These are connected by a series of relationships.
Again, the number of relationships is quite limited, but each has specific meaning in the diagram.
- Conform
- Dependency
- Import
- Containment
- Realization
- Refine
- Expose
As with all SysML elements, there is both a graphical and textual aspect to the elements, notes can be added to each of the Packages and the relationships to clarify the purpose of the element or the connector. The Package diagram can contain any type of model element but typically it contains Packages. Enterprise Architect extends the SysML specification by providing a number of different and innovative ways to visualize Packages and their content on a Package diagram. These options can be seen in the menu that is displayed when a Package is dragged from the Browser window onto a diagram.

In this diagram we can see that the modeler has chosen the 'Package Element' option and has set the Compartment Visibility of the Package diagram object to display the Package contents. The Compartment Visibility options are available from a diagram object's context menu for any element, and Enterprise Architect dynamically changes the options depending on the element type and the available compartments.
In the next diagram the engineer has chosen the 'Package as List' option, which relies upon auto-generated but user-configurable SQL code to create a dynamic list of elements based on any of the Package element's metadata. Here we see the same list of requirements but this time a number of properties are also displayed.
Any number of Package diagrams can be created to define or help visualize the structure of the repository. For more information see the Package Diagram Help topic.
Creating Package Diagrams
A Package diagram can be created from a number of places in the User Interface, by selecting:
- Design ribbon - Add icon on the Diagram panel
- Browser window toolbar - New Diagram icon
- Browser window context menu - Add Diagram
The access options will all display the same dialog, they are simply different entry points to the same tool features. We will use the Design ribbon to create a Package diagram.
Firstly select the location in the Browser window where you want the Package diagram to be located. This can be either a Package or an element, but it is common to insert Package diagrams into a Package. Once the Package location has been selected in the Browser window, select the ribbon option:
Design | Diagram | Add

Selecting this option will open the New Diagram dialog, on which you name the diagram; the name initially defaults to the name of the Package or element that contains the diagram. With the SysML perspective chosen and the version of SysML selected, a list of diagrams will be displayed from which you select the Package diagram. Click on the Diagram View will be opened, allowing you to start adding elements and connectors that describe the structure of the system and its division into these structural groups. Enterprise Architect will also display the 'Package' Toolbox pages that contain the elements and relationships as defined by the SysML specification to be applicable for constructing Package diagrams. Any number of other Toolbox pages can be opened, if required, in addition to the 'Common' elements and 'Common Relationships' pages that will always be available.
to create a new Package diagram in the location selected in the Browser window. The
The most import elements and connectors that are used with the Package diagram are:
Elements
- Model - used to define a high level part of the system
- Model Library - used to define a reusable set of elements
- Package - used to create a basic structural unit
- View - used to define what a stakeholder will see when viewing
- Viewpoint - used to define a reference point for a view
- Stakeholder - used to describe people or parties with material interest
Connectors
- Conform
- Dependency
- Import
- Containment
- Realization
- Refine
- Expose
Elements can be added to the diagram by dragging-and-dropping them from the Toolbox onto the Diagram View. It is considered good practice to start by defining Model and Model Libraries. When a Model or Model Library icon is dragged from the Toolbox to a diagram, the modeler will be prompted to enter a new Package name using this dialog:

Once the Package name has been entered a new Package element will be created on the diagram. When creating a Package from the Toolbox or inserting one into the Browser window, a modeler is given a number of options as indicated on the dialog in this screen capture.

As described earlier, when an existing Package is dragged from the Browser window (or copied from an existing diagram) Enterprise Architect allows you to create it in a number of different ways, as indicated in this screen capture:
