Wolfram Language Paclet Repository
Community-contributed installable additions to the Wolfram Language
UML diagrams generation by introspection and direct specs
Contributed by: Anton Antonov
This package has functions for the generation Unified Modeling Language (UML) diagrams according to specified relationships of symbols that represent classes and by introspection of code.
To install this paclet in your Wolfram Language environment,
evaluate this code:
PacletInstall["AntonAntonov/UMLDiagramGeneration"]
To load the code after installation, evaluate this code:
Needs["AntonAntonov`UMLDiagramGeneration`"]
Let us visualize a simple relationship between buildings, people, books, and a client program:
In[1]:= | ![]() |
Out[1]= | ![]() |
In the diagram above the classes Person and Building are abstract (that is why are in italic). Member inherits Person, Library and Museum inherit Building. Library can contain (many) Book objects and it is associated with Member. Client associates with Building and Person.
Let us look into a simple UML generation example for the design pattern Template Method. Here is the Wolfram Language (WL) code for that design pattern:
In[2]:= | ![]() |
Here is the corresponding UML diagram:
In[3]:= | ![]() |
Out[3]= | ![]() |
Here is a restyled version of the diagram above:
In[4]:= | ![]() |
Out[4]= | ![]() |
Here is an example of UMLClassNode usage:
In[5]:= | ![]() |
Out[5]= | ![]() |
Here is an example of PlantUML usage:
In[6]:= | ![]() |
Out[6]= | ![]() |
Here is the image generated by PlantUML: