Skip to main content
Jump to: navigation, search


The goal of the ModelFilter plug-in is to extract specific information from java projects, and to show it as UML models.

  • First application is to initialize a graph of dependencies from one selected element, with the level of recursion provided as a parameter.
  • Second application is to show method calls as a pseudo sequence diagram using dependencies between methods, numbered from 1 to n to indicate the order.
  • Third application is to represent the real type of properties when an interface has been used in java code.


To discover an application, you may use SimpleTransformationsChain to obtain a UML model which represents the whole application structure. Or you may use the ModelFilter plug-in to focus on different aspects. It could be represented by little models dedicated to one element, or a complete model but with added information. Depending on the complexity of the application and resulting UML model, you will have to select a different kind of model.

The dependencies graph is clearly well fitted to show how several little models could be useful. Representation of method calls as a pseudo sequence could be done by little models or by one complete model; it has been implemented as one model to show how different diagrams have to be used to mask complexity of model elements. And representation of real type for properties show how a complete model could be improved with a few details.

Dependencies graph

From a selected class in a java application, you choose the recursion level of the search for dependencies and you will get a UML model which represents a dependencies graph from the selected class. Structural links, like association, inheritance, etc. are of course available, but we have added UML dependencies to show local uses of a type, or method parameters. It is very useful to detect usage of qualified types or usage of a type in the same package.

Sample of target UML model with local and method parameters dependencies.

Method calls

To represent method calls as pseudo sequence, we use UML dependencies from one method (caller) to other methods (callee). Each dependency is named with the name of the called method suffixed by a number which represents its order in the sequence of method calls.

Sample of target UML model with method calls as dependencies.

Real type of properties

When the type of a property is an interface, it is interesting to represent its real type dependency in a UML model.

Sample of target UML model with real types as dependencies.


Eclipse Helios with modeling plugins:

  • EMF
  • EMF UML2
  • UML2 Tools
  • ATL 3.0.0

For advanced users in modeling, we advice to use the Papyrus modeler instead of UML2 Tools.

Warning : after installation, you will have to change your eclipse settings (file eclipse.ini) to increase memory size allowed to 1GB at least, with the "-Xmx1024m" parameter.

Example :



Gabriel Barbier (Mia-Software)


You can install the discoverer from the MoDisco update site.

User manual

To illustrate the ModelFilter plugin and its features, we will use a sample inspired from the Pet Store Application.

Get and install use case

The models are available from the MoDisco SVN in subdirectory "examples/trunk/org.eclipse.gmt.modisco.usecase.modelfilter.sample" or from a downloadable archive. If you use a SVN client in Eclipse (Subversive or Subclipse), the project will be immediately available in your Eclipse workspace.

Sources of the Pet Store application are available here:

You may have to download several libraries to obtain an eclipse project without errors (JPA, JTA, JSF-apis and Servlets-jsp-apis). A complete bundle is also available from Mia-Software... To view this application in your Eclipse workspace, you will have to extract the content of this archive, and use the "import" wizard (import project in workspace).

Dependencies graph

To get the dependencies graph of a particular class, you have to right-click on the class in the Package Explorer, and select Discovery > Actions > Display Dependencies

Contextual menu entry for Display Dependencies

Then, a graph displaying the dependencies will open:

Dependencies graph

Method calls

Right-click on a project and select Discovery > Actions > Display Method Calls. A graph display all the method calls will open:

All method calls
You will have a better look if we focus on a particular method. For example, the method
public List<SelectItem> getCategories()
in class MapBean located in package com.sun.javaee.blueprints.petstore.mapviewer.
    public List<SelectItem> getCategories() {
        // return categories for a JSF radio button
        ArrayList<SelectItem> arCats=new ArrayList<SelectItem>();
        // get the CatalogFacade for the app
        FacesContext context=FacesContext.getCurrentInstance();
        Map<String,Object> contextMap=context.getExternalContext().getApplicationMap();
        CatalogFacade cf=(CatalogFacade)contextMap.get("CatalogFacade");
        // get the categories from the database
        List<Category> catsx=cf.getCategories();
        for(Category catx : catsx) {
            // add categories to be displayed in a radio button
            arCats.add(new SelectItem(catx.getCategoryID(), catx.getName()));
        return arCats;

Right-click on the method in the Package Explorer, and select Discovery > Actions > Display Method Calls:

Displaying method calls from a single method
A graph displaying method calls from method "getCategories"

Real type of properties

Nota: to represent real type of properties, we have to use a modeler which is able to show dependencies between an association and a class, these elements being located in different packages. Then, following diagrams have been created with Papyrus and not with UML2 Tools.

To get the UML model with real type of properties, select the java project you would like to inspect. Then in contextual menu, navigate in "Modelplex Use Cases" menu, click on "Create uml model with real types information on associations" menu item.

Contextual menu entry for Modelplex use cases.

Then, you will have a complete UML model instrumented with dependencies to represent method calls.

Sample of target UML model with specific dependencies.
You will have a better look if we focus on a particular association. For example, the properties
private Collection<Item> items
in class Tag and
private Collection<Tag> tags
in class Item both located in package com.sun.javaee.blueprints.petstore.model.
A diagram build with Papyrus to show real types.

Current limitations

Dependencies graph

  • The dependencies gaph does not reflect some implicit dependencies, for example with embricated method calls:
String entryPagesParam = filterConfig.getServletContext().getInitParameter("entryPages");

Method calls

  • Diagrams have to be built manually with Papyrus
  • Method calls should be represented with a uml sequence diagram

Real type of properties

  • Diagrams have to be built manually with Papyrus
  • Initializations through parameters or local variable are not managed
  • Initializations through method call are not managed

Components Infrastructure: KDM · SMM · GASTM · Model Browser · Discovery Manager · MoDisco Workflow · Query Manager · Facet Manager · Metrics Visualization Builder · KDM Source Extension
Technologies: Java · JEE · EjbJar · WebApp · XML
Use Cases: Simple Transformation Chain · Model Filter
Help Installation · SVN
Project API Policy · Retention Policy · Project Plan · metrics · Accessibility Guidelines · Capabilities Disablement

Back to the top