The plug-in generates C++ / C# / Crystal / Golang / Java / JavaScript / Kotlin / Python / Ruby / Scala / Swift / TypeScript / Alloy / VDM++ code from UML structural elements (such as classes and relationships).
The generated code includes User Code Area, which is an area enclosed by "˅" and "˄". Handwritten code is allowed only in the User Code Area. The code in this area remains after re-generation.
This feature supports synchronizing the design model with the code, allowing you to design based on the model that precisely represents the implementation during the design phase.
② Select structural elements (e.g., packages and classes) in the model browser and press the Code button. If you select packages, all the structural elements under them will be processed.
The m+ plug-in basically generates one file per class; only in the case of Alloy does the plug-in generate one file per package.
③ Open the generated code and handwrite code in the User Code Area. The User Code Area is an area enclosed by "˅" and "˄". The generated code is encoded with UTF-8.
The plug-in supports programming language-specific extensions (e.g., enumerations in Python and decorators in TypeScript) using stereotypes and tagged values. See the Tips sections for details.
Note 2:
The plug-in outputs a configuration file (m_plus.conf). We recommend managing this configuration file together with the model file (*.asta). It contains information about the target directory, programming language, and other settings.
Generate a structural diagram using PlantUML and Graphviz.
This diagram facilitates the understanding of the structural aspects of the model.
Select structural elements (e.g., packages and classes) in the model browser and press the Structural diagram button. If you select packages, all the structural elements under them will be processed.
Note:
You need to install Graphviz if you are on Mac or Linux. See the Install section.
Generate a directed graph that shows the reference relationships of structural elements.
This graph facilitates the understanding of the relationships among structural elements.
Generate a diagram map that visualizes the links among related model elements and diagrams.
This map allows you to trace the model elements across diagrams. The term "Diagram map" is one we coined and is not a general term. For more information on Diagram map, see this post.
Select diagrams in the model browser and press the Diagram map button. If you select packages, all the diagrams under them will be processed.
Diagram map shows:
links between the following elements of the same type.
Classifier
Object
Object Node
Lifeline
Diagram positioned directly under the Classifier
references between elements and diagrams (e.g., a reference between an action and an activity diagram).
hyperlinks using tooltips.
The diagram map works similarly to Google Maps. You can zoom and pan using a mouse.
Generate a relationship matrix that represents the relationships of structural elements.
This matrix allows you to visualize the dependencies of structural elements in a tabular format.
Select structural elements (e.g., packages and classes) in the model browser and press the Relationship matrix button. If you select packages, all the structural elements under them will be processed.
The plug-in tries to sort the structural elements of items so that the markers appear above the diagonal.
If you want to show/hide markers for each type of relationship (association, generalization, realization, and dependency), you can do so by using the Relationship Show/Hide add-in. See this Tips for how to use the add-in.
Tips: Show/Hide Markers for Each Type of Relationship
Generate an additional document that explains structural elements through text and diagrams, using PlantUML and Graphviz.
This text-based document is useful when combined with structural diagrams, directed graphs, and diagram maps, as it displays explanatory text for elements on hover, allowing you to quickly view their descriptions.
Select structural elements (e.g., packages and classes) in the model browser and press the Additional document button. If you select packages, all the structural elements under them will be processed.
Note:
You need to install Graphviz if you are on Mac or Linux. See the Install section.
Highlight the display position of the hovered element with a tooltip across structural diagrams, directed graphs, diagram maps, and additional documents.
This feature makes it easy to identify where the hovered element is displayed in other documents.
Ex. Highlighting between structural diagram and directed graph
Ex. Highlighting between diagram map and additional document
When you hover over a structural element (e.g., class and interface) in a structure diagram, directed graph, diagram map, or additional document, a tooltip highlights the corresponding element in other documents that are not in focus.
Note:
This feature uses the Broadcast Channel API, so the feature is only works in modern browsers and with same origin. If you want to know about the Broadcast Channel API, see here.
Notice:
This feature does not work in Firefox due to the following issue:
https://bugzilla.mozilla.org/show_bug.cgi?id=1600512
Structural diagrams, directed graphs, diagram maps, and additional documents can be displayed in monochrome to reduce visual load and strain.