company logo

UML Graph

The ClassEditor supports graphical class diagrams. From the user type and class definitions stored in the database model an UML Diagram will be generated and displayed using GraphViz.It is also possible to store and update the generated UML definition in order to provide a more specific view to the class diagram.

Prerequisites

The rendering of the UML is done using GraphViz, a open source network/graph visualization project. GraphViz is not part of the ODABA Installation so you have to download it yourself from GraphViz.org. You have to make sure the 'dot' executable provided by the installation is in your path - something that is not so simple on the Windows platform. Linux users may ask their package manager and should get a graph without restarting the ODE.

Simple UML

UML can be a complex tool, and the worst thing you could do is try to put everything that a program could learn from the code into a single graph. Therefore the Graph view starts with its most simple option, displaying the currently selected class in a class diagram without any members, relations.

Settings

The Graph view can be changed to display different aspects of the class. Some settings are costly, as they check the database in reverse, some just make the image have more information. The Settings can be reached using the Context-Menu on the graph and select settings.

  • Show basing on/Depth basing on (option DepthBasingOn)

Display which classes inherit the currently selected class. Using a higher Depth value causes every displayed class to show its basing on -classes until the given level is reached

  • Show based on/Depth based on (option DepthBasedOn)

Display which classes the currently selected class inherits. Using a higher Depth value causes every base class to show its base-class until the given level is reached.

  • Size in inch (option Size)

Limit the size of the graph and therefore scale the contents - this may render the contents unreadable, but can help to get a overview

  • Functions (option ShowFunctions)

Display the classes functions or methods in the Graph - this creates a lot of text in the graph and may only be useful when you don't use the base/reference options

  • Member (option ShowMember)

Display the classes member or attributes in the Graph

  • Referencing classes ( option ShowReferencingClasses)
  • Display the classes that use the selected class. This is knowledge of the ClassEditor when you use the class as a type or as a parameter. It may skip concurrences of the class in the source code.

  • Referencing member (option ShowReferencingMember)

Display the classes that use the selected class as member. This should be the reverse of 'Referencing members' in the Properties tab


To apply the settings one may press OK and make the settings persistent for the current session of the ODE. Cancel loads the current settings. In order to make the Settings for the UML persistent, the values might be set as option values in the user configuration as sub options for Options.Documentation.Graph


Edit/Source

One may view and edit the generated source using the Source View. You can see the dot-language that is used to render the graphs. When you like to change the graph you can do that, but keep in mind that your changes are not persistent. The edit option in more a sketch-pad for discussions. To display the changes you have to select 'Redraw' in the context menu.


Save/Print

You can use the Print item from the context menu to print the displayed graph- a quick way to make handouts, or you can save the rendered image for further processing.


Enhancements

We still do not nearly display everything that the database could extract from the definitions and for sure your UML has some very special requirements. So all you have to do is changing the rules of the UML Generator in the development database ode.dev. The key implementations are in ODC_ImpClass and SDB_Structure in the 'adk' project. All UML Functions start with GetUML_().

When you change the code you can 'Tools->Reset cache' to make the changes available in a running instance of the ODE. If you like to share your enhancements with us, one may create a external file by uncheckable the 'no-compile' option, and generating the SDB_Structure.osi file.