Modelio can analyze a Java model and automatically build certain diagrams focused on Java structuring elements such as classes[1] and packages. This functionality is called "automatic generation of Java diagrams".
The generated diagrams all have a well-defined and guaranteed content and they all present a particular aspect of the model relating to the so-called subject model element that was chosen to create them.
The table below lists the types of automatic diagrams offered and their content:
Subject | Available automatic diagram types for Java |
---|---|
Package |
Dependency diagram, Sub-package structure |
Class, Interface, DataType, Enumeration |
Class structure |
![]() |
Some of these automatic diagrams are embedded in the enriched Javadoc produced by Java Architect. |
Generating the automatic diagrams
-
Select a Java Package, Class, Interface, DataType, Enumeration or Component, to be the subject of the diagram
-
Use the "Java Architect→Create element→Automatic diagrams" command from the contextual menu of the selected element
-
Java Architect creates, draws and opens the diagram under the selected element.
The command will recursively create the following automatic diagrams based on the type of the element reached by the recursion:
-
on Package : Dependency diagram, Sub-package structure diagram
-
on Class[1] : Class structure diagram
-
on Component : Sub-package structure diagram
![]() |
Don’t forget to create an Impact sub-project to display impact links in the diagrams. |
Updating an automatic diagram
-
Select a previously generated automatic diagram
-
Use the command "Automatic diagrams→Update automatic diagrams"
The command will update the diagram by adding and removing contents where needed and restoring the initial automatic layout.
Reusing the Create/Update command
-
Select a Java Package, Class, Interface, DataType, Enumeration or Component
-
Use the "Java Architect→Create element→Automatic diagrams" command from the contextual menu of the selected element.
Types of automatic diagrams for Java
In the Java world the following automatic diagrams are proposed:
Dependency diagram
Usage
Automatic dependency diagrams are used to show the incoming and outgoing dependencies of a namespace N (the selected package, class and so on.) in order to situate it within the system. This type of diagram answers the questions of "Who uses N?" and "Who does N depend on?".
Contents
For a given NameSpace N the dependency diagram shows incoming and outgoing dependencies of N.
For a NameSpace N the dependency diagram displays:
-
N itself in a central position.
-
Incoming links: all the elements having a dependency towards N, laid out on the left of N along with their links to N.
-
Outgoing links: all the elements N depends on laid out the right of N along with their links from N.
Example
The following image shows a Dependency diagram generated by the Modelio automatic diagram feature.
Sub Package Structure diagram
Usage
The sub package structure diagram shows the internal structure of a package, in other words the first level content of this package, along with the dependencies that exist between its sub-packages. These dependency links are generally a good indication of the design quality of the package by showing its internal coupling and overall cohesion. Most often a thorough examination of these links will reveal unwanted dependencies (even cycles sometimes) and will greatly help improving the design.
Contents
For a package P the sub package structure diagram displays:
-
The sub-packages of P
-
The impact links, as computed by Modelio impact analysis feature, between those sub-packages. These oriented links show how the sub packages of P are depending on each other along with an indication of 'why' they depend on each other (list of causes available from the displayed link by a right-click).
Example
The following image shows a sub package structure diagram generated by the Modelio automatic diagram feature.
Class Structure diagram
Usage
The class structure diagram shows a synthesis about a class:
-
its inheritance parent
-
its associations to other elements
The class structure diagram is typically a documentation diagram about a class. This is why it is also embedded in the enriched Javadoc produced by Java Architect.
![]() |
Need to know how a class is made? just have a quick look at its automatic class structure diagram and you’re done. |
Contents
For a class C, the class structure diagram displays:
-
C itself in the center.
-
C's public attributes.
-
C's parent classes/interfaces if any.
-
C's associations, compositions and aggregations.
Example
The following image shows a class structure diagram generated by the Modelio automatic diagram feature.