d2uml 0.1.0

Reverse engineering of D source code into PlantUML classes


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

D to UML

Build Status

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.

Usage

Use dub to build the tool:

dub build --build=release

Use the tool to extract the class outlines from D source code.

For example:

./d2uml src/*.d > model/classes.plantuml

Create another file and explicitly specify the relations between the classes. Use the !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:

model/diagram.png

  • Duml: a similar tool based on a different approach (CTFE)
  • depend: a tool to check actual import dependencies against a UML model of target dependencies
Authors:
  • Mario Kröplin
Dependencies:
libdparse
Versions:
0.2.3 2023-Jun-29
0.2.2 2018-Nov-30
0.2.1 2018-Sep-17
0.2.0 2018-Sep-04
0.1.2 2018-Aug-29
Show all 8 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 17 downloads total

Score:
1.0
Short URL:
d2uml.dub.pm