Reverse engineering of D source code into PlantUML classes
To use this package, run the following command in your project's root directory:
Put the following dependency into your project's dependences section:
D to UML
UML diagrams can be helpful for code maintenance. But, drawing these diagrams with mouse and keyboard is a tedious task. And popular UML tools don't support reverse engineering for the D programming language.
This tool uses libdparse to parse the given D source code
and it extracts class outlines in the PlantUML language.
Not only a
class, but also a
struct, and even a
module is turned into a class outline.
A good arrangement of the classes is essential for creating effective UML diagrams. The means for tweaking the arrangement is to explicitly specify the direction of arrows: Changing arrows direction. Such an artistic design, however, is beyond the capabilities of this pragmatic tool. So, this tool does not even try to extract relations between classes.
Use dub to build the tool:
dub build --build=release
Use the tool to extract the class outlines from D source code.
./d2uml src/*.d > model/classes.plantuml
Create another file and explicitly specify the relations between the classes.
!include directive to include the generated file.
For example: model/diagram.plantuml
@startuml hide empty attributes hide empty methods !include classes.plantuml main .> Outliner ASTVisitor <|-- Outliner Outliner -> "*" Classifier Classifier --> "*" Field Classifier --> "*" Method Outliner ..> outliner @enduml
Use plantuml.jar to generate the image of the diagram:
java -jar path/to/plantuml.jar model/diagram.plantuml
Finally, have a look at the resulting image:
- Registered by Mario Kröplin
- 0.2.1 released 5 years ago