Generate Salesforce Apex Code documentation, with navigatable UML

Approach 1: Doxygen + Graphviz Dot + Mscgen (Windows-centric)

Provides clickable UML, takes some setup time for initial setup.

  1. Install Doxygen: http://www.stack.nl/~dimitri/doxygen/
  2. Install Graphviz Dot: http://www.graphviz.org/Download_windows.php
  3. Install Mscgen: http://www.mcternan.me.uk/mscgen/
  4. Configure Doxygen GUI frontend (Doxywizard)
    1. Specify project name, src and destination dirs (choose path close to root to avoid Windows path length issues)
    2. Choose Mode: Java/C#
    3. Choose Output: e.g. HTML with nav panel & search function
    4. Choose Chart type: Use dot tool
    5. Under Expert > Dot
      1. The Mscgen_path, probably: Program Files (x86)\Mscgen
      2. Dot_path, probably: Program Files (x86)/Graphviz2.38/bin
      3. Turn on Have_Dot, Class_graph, Collaboration_graph, Group_graphs, Call_graph, Caller_graph
      4. I would set Dot_image_format to SVG and turn on Interactive_svg
    6. Start a Doxygen run to generate documentation (if you don't get any graphs, a path is not set properly)
  5. Save your configuration (you get a "Doxyfile" file), and check it in (I wouldn't put generated html in version management, it is better hosted in a different way)
  6. If you want to see SVG graph thumbnails in Explorer: https://svgextension.codeplex.com/releases/view/118790



If you have chosen HTML as format you can see the project overview under:

Classes > Class Hierarchy > Go to the graphical class hierarchy

This shows global UMLs of the project, where elements are clickable. You can also go to a class with the search function, and click through the UML to navigate.

For Salesforce Apex projects:

  1. Same as above, and…
  2. Enable *.cls extension under Expert/Input/File_Patterns
  3. Under Expert/Project/Extension_Mapping add cls=Java
  4. Enable EXTRACT_ALL to EXTRACT_LOCAL_METHODS under Export/Build



Aanpak 2: Doxygen + Mscgen + Msc-generator

For flow structograms, but without the Visio mouse RSI hassle.

Easily create structograms to describe a project/change, without graphical editing, and so that it works together with version control (text-only)
  1. Install Mscgen as per Doxygen (Affero GNU Public License) http://sourceforge.net/projects/msc-generator/
  2. Open Msc generator
  3. Enter structogram code as on their site
  4. Check your *.signalling chart src and possibly. a screenshot in version control at the project
There's even a Jira plugin to post visualization directly to issues:
https://marketplace.atlassian.com/plugins/com.addteq.jira.plugin.mscgen.JIRA-Mscgen

Why consider MuleSoft?

MuleSoft with its Anypoint Platform is a growing integration platform for IT services. Dissimilar data sources and services become much easier to integrate, without having to manually code x connectors, translators and such. Going to mulesoft.com and sniffing the freely available tutorials and software can give you an impression.


The MuleSoft ecosystem

But I feel there is another, perhaps paramount benefit to considering MuleSoft. The very way the web-based Anypoint Platform and the Eclipse-based Anypoint Studio work helps streamline working teams. The design-first API approach and the segmentation into message processors make development steps and areas of responsibility more explicit.

Your development team might consist of advanced coders who like to do everything on their own, configurators and designers who like to do things once and move on to the next thing. Average developers might prefer to cleary stipulate the inputs, possible sideeffects, testing approach and outputs of modules.
Breaking large integrations into LEGO-like blocks like Mule might seem bothersome for the brilliant solo coders out there, but I think it can be pure gold for large teams that want to predictably deliver software.

MuleSoft Anypoint Studio flow building blocks












Attacking a problem by first defining the interfaces and resources with RAML, then top-down configuring flows for the needed input and output data types can already replace a number of classical documents and prevent misconceptions. Some steps can even be done during meetings, and with a shared screen can ensure everyone agrees on what needs to be done. The flow "skelet" of different connectors, transformers, and configuration steps can be assigned to different developers in such a way that they don't get in each others way. With the help of easily defined example data and mockable services, entire projects can be demo-ed within an hour or two, and the actual "flesh" added iteratively during more predictable development cycles.

Especially in fast-moving cloud projects that want to quickly connect with a new system, MuleSoft seems to be able to fulfill its promises. If your team(s) find themselves often arguing over precise definitions, boundaries of responsibilities, and acceptable complexity, Mule might help streamline those coding nerves.