Giter VIP home page Giter VIP logo

d2uml's Introduction

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.

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

Related Projects

  • 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

d2uml's People

Contributors

linkrope avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.