At the beginning of the project you have a limited number of diagrams, everything are simple and beautiful. But when time flies, more and more diagrams being created in the project, things become unmanageable. Your project become hard to navigate, difficult to locate the diagrams which you want to review or make changes.
How can we fix it up? We can make use of the Package Diagram to organize your diagrams into different packages. This helps you to categorize your diagrams according to their nature, make it easier to navigate and locate. The Package Diagram also serves as the catalog for you to jump to the diagram you looking. In this tutorial we will show you how this work.
Create Packages for your diagrams
We first need to have our packages ready. To create packages:
- Go to Application Tool Bar > UML > Package Diagram.
- Name the package diagram as Racing Game Packages.
- Click the Package button in diagram tool bar, then click on the blank area of the diagram to create the package.
- Name the package as Race.
- Repeat the steps to create the package Tuning, Security and General.
Organize diagrams with Packages
Once the packages are ready, we can then start to organize our diagrams.
- Click on the Race package to bring up the sub-diagram resource icon.
- Click on the resource icon, then select Existing Diagrams... from the popup menu.
Select the following diagrams in the Add Sub Diagrams dialog, then Press OK to commit.
- [Class Diagram] Race Tracks
- [Class Diagram] Race Type
- [Class Diagram] Racing Game
- [Sequence Diagram] Register to race
- [Communication Diagram] Register to race - Communications
- [State Machine Diagram] Race Series State
- [Activity Diagram] Register to race
- [Entity Relationship Diagram] Player Race
- [Entity Relationship Diagram] Race Series
- [Entity Relationship Diagram] Racing Game
Repeat the steps for the following packages and diagrams
[Class Diagram] Tuning
[State Machine Diagram] Car State
[Entity Relationship Diagram] Cars
[Sequence Diagram] Game Service Login
[Sequence Diagram] Purchase Add-ons (fail)
[Sequence Diagram] Purchase Add-ons (success)
[Sequence Diagram] Racing Game Login
[Business Process Diagram] Purchase Add-ons
[Use Case Diagram] Racing Game Use Cases
[Component Diagram] Game Components
[Deployment Diagram] Game Deployment
[Requirement Diagram] General Requirements
[Matrix Diagram] Classes Matrix
[Matrix Diagram] Entity Matrix
[Matrix Diagram] Process Matrix
[Analysis Diagram] Player Analysis Diagram
Define relationships between packages
Now our diagrams are being structured with the packages, we can then define the relationships among the packages. To create relationships between packages:
- Click on the Race package to show up its resource icons.
- Drag out the Dependency -> Package icon and drop it over the Security package.
- Repeat the steps to create dependency from Tuning to Security, also from Security to General.
Navigate between package and contained diagrams
The Package Diagram can always be the starting point for you to navigate within your project. To navigate to a diagram:
- Click on the package to bring up the resource icons, say the Race.
- Click on the sub-diagram resource icons. This will bring up a list of sub-diagrams under the Race package.
- Locate the diagram from the popup menu, say the Racing Game class diagram, and then click on it.
- You are now being brought to the Racing Game class diagram.
- You can go back to the package by clicking the link in the top left hand corner of the diagram.
Publish project to HTML with Package Diagram as navigation map
This kind of handy navigation is not limited to within the application. You can also have it inside the published HTML website. To publish your project into a HTML website:
- Save your project by pressing the Save button at the Application Toolbar.
- Go to Doc > Project Publisher... in Application Toolbar.
- Enter the output location for the publisher in the Output directory field.
- Press the Advanced Options... button to bring up the advanced settings.
- Select index.html (without menu) in the Generate menu combo box.
- Select Open subdiagrams in Drill down effect for general models.
- Choose Select a diagram in the Default diagram combo box.
- Pick the Racing Game Packages and press OK.
- Press OK to close the Advanced Options dialog, and press OK again in the Project Publisher dialog to start publishing.
- Press OK when publishing is completed. This will launch the browser will start automatically with the Racing Game Packages diagram showing.
- You can click on the package to bring up the popup menu to jump to the sub-diagram, say the Racing Game class diagram.
- And in the sub-diagram you can always go back to the parent package by clicking the link at the top of the page.
Download Sample Project
You can download the sample project to walk through this tutorial.
Watch this Tutorial on YouTube
Here is the video version of this tutorial.
- More about Package Diagram
- Publish project as web content