Wednesday, 17 February 2010 05:18

Visualization of Package Dependencies

Written by
Rate this item
(3 votes)

When reverse engineering existing source code into Enterprise Architect, there is an option to import dependency relationships based on operation return types and parameter types.  These dependencies are only shown between individual classes.  Some users however, wish to view implicit dependencies at the Package level, which Enterprise Architect does not generate by default.

The purpose of these scripts is to generate implicit dependencies at the package level based on the contents of the packages, and to assist with drawing a diagram to show these cross-package dependencies.


Configuring the scripts

In this example, we will take advantage of the new ability to call scripts directly from the Project Browser, introduced in Enterprise Architect 8.0.

  1. Open the scripting window (View | Scripting)
  2. Create a new script group
  3. Name the group "Project Browser"
  4. Set the group type to "Project Browser"
  5. Create a new VBScript under this group and name it "Synchronize Package Dependencies"
  6. Open this new script in the built-in editor and paste in the contents of the file VBS_SynchPackageDependencies.txt
  7. Save
  8. Create another new VBScript under this same group and name it "Synchronize Package Dependency Diagram"
  9. Open this new script in the built-in editor and paste in the contents of the file VBS_SynchPackageDependencyDiagram.txt
  10. Save


Using the scripts

With the scripts successfully added to your model, select the root package in the Project Browser from where you wish to generate your cross-package dependencies. To see the messages output by this script, make sure to open the Output window (View | System Output).

  1. Create a new Diagram of type 'Package' and open it (this diagram is where the dependencies will be drawn)
  2. Right-click on the context package in the Project Browser and select "Scripts | Synchronize Package Dependencies".  The Output window will inform you when the process has been completed and report how many new package dependencies have been found.
  3. Right-click on your context package in the Project Browser again and select "Scripts | Synchronize Package Dependency Diagram"
  4. Several packages should now appear on your open diagram, but will all be piled on top of one another.  We can now use EA's automatic diagram layout tools to organize these packages into a sensible layout.
  5. Open the Diagram Layout window ("View | Layout Tools")
  6. Select "Digraph" layout and click the "Apply Layout" button

These scripts can be executed again at any later time to update any changes in your cross-package dependencies that may have occurred since the original execution.  Dependency relationships are added and removed between packages as necessary by running the “Synchronize Package Dependencies” script, and running the “Synchronize Package Dependency Diagram” script again can automatically add/remove packages from the currently open package diagram to show the items that are now relevant.  If any items are added or removed from the diagram, you may need to run the automatic diagram layout tools again.





Read 16136 times Last modified on Tuesday, 09 April 2013 04:47

Sparx Systems

99 Albert Street
P: +61 3 5345 1140
F: +61 3 5345 1104
Sparx Systems specializes in high performance and scalable visual modeling tools for the planning, design and construction of software intensive systems. A Contributing Member of the Object Management Group (OMG), Sparx Systems is committed to realizing the potential of model-driven development based on open standards. The company’s flagship product, Enterprise Architect, has received numerous accolades since its commercial release in August, 2000. Enterprise Architect is the design tool of choice for over 740,000 registered users worldwide.


  • Comment Link Antonio Gargano Friday, 26 June 2020 07:38 posted by Antonio Gargano

    Hi all,
    Thanks for the Scripts,

    How can i use the dependecy graphics for branch merge process?


  • Comment Link Girish M Friday, 25 November 2016 04:35 posted by Girish M

    This does't work for EA 12 (the scripts run successfully but the open package diagram is not updated).

    Can we get the updated scripts please?

  • Comment Link MarcioMonego Wednesday, 08 April 2015 17:15 posted by MarcioMonego

    Congratulations for this,
    I have use it since it was created.
    I can't understand why this feature wasn't integrated in EA yet.
    I give my vote.

  • Comment Link Lehmann Wednesday, 15 October 2014 16:06 posted by Lehmann

    this seams to be very interesting for me. Unfortunately I cant find the mentioned scripts:
    - VBS_SynchPackageDependencies.txt
    - VBS_SynchPackageDependencyDiagram.txt
    Could you please offer them to me?

Login to post comments