UML Output

Generate an XML file for graphing your application via Eclipse UML2Tools

UML2 Tools hasn't been developed for Eclipse since 2008. This strategy is now more for reference than anything else.

This is a documentation strategy that ultimately lets you generate UML diagrams from the CFCs that you have written. That being said, it does not actually generate diagrams.

What this template startegy does is generate the XML file the Eclipse UML2 Tools that stores the information about your domain - the classes, the associations, the inheritence hierarchy, etc. From there it is very easy with UML2 Tools to generate UML diagrams like Class Diagrams, Sequence Diagrams, etc.

To get started, you need to download and install the Eclipe plugin UML2 Tools in your Eclipse install.

  1. We are actually going to use the 0.9.1 Integration Builds plugin, simply because it is more stable, and has several key bug fixes.

  2. Download the All-In-One Update Site and save the .zip file

  3. In Eclipse, go to Help > Install New Software

  4. Click Add

  5. Enter the name UML2 Tools in Name

  6. Click Archive and select the .zip file you downloaded.

    1 . Click OK, and continue through the installation process

Once that process is complete, the Eclipse UML2 Tools plugin should now be installed and working.

To get DocBox to generate the .uml file that UML2Tools needs, we use the UMLstrategy. For example:

docBox = new DocBox();
docBox.addStrategy( "UML", { projectFile = expandPath( "./uml/docbox.uml" ) });
docbox.generate( expandPath("/docbox"), "docbox" );

This will generate the .uml (in this case docbox.uml) file which we can then use.

To view and edit the UML diagrams from here:

  1. Browse to the .uml file that you generated in the Navigator Pane

  2. Right click on the .uml file

  3. Select Initialise Class Diagram

  4. Select the root package that you wish to model

  5. Click OK

You will now be presented with a UML Class diagram of your CFC model.

There are other types of UML2 diagrams that can be created. Have a look at the UML2 Tools documentation for more options.

Strategy Assumptions

There are some assumptions that are made by this strategy, when converting from CFCs to UML diagrams, as some meta data on CFCS are not provided and/or cannot be specified.

  • A property/field is determined for a class when a get and set function exist with the same name (or set and is for boolean values) and the argument type of the set function matches the return type of the get/is function.

  • The scope for the property/field is selected by highest level of exposure between the get and set functions. I.e. if getFoo() is public, and setFoo() is private, then the property foo is marked as public.

  • All associations are of type aggregation, rather than composition

Last updated