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 includes functions for creating Unified Modeling Language (UML) diagrams based on specified relationships between symbols that represent classes, as well as through code introspection.
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]= |
The outputs of UMLClassNode are used in graphs representing UML class diagrams. Here UMLClassNode is used to produce different UML versions a class representation:
In[5]:= |
Out[5]= |
Here is an example of PlantUML usage:
In[6]:= |
Out[6]= |
Here is the image generated by PlantUML: