Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool for generating UML class diagram from Doctrine annotations [closed]

I am looking for a tool that would generate an UML class diagram from Doctrine's @ORM annotations. Especially showing the relations between entities would be useful. Is there any such tool?

like image 303
Dawid Ohia Avatar asked Jan 17 '12 15:01

Dawid Ohia


People also ask

How can I automatically generate a UML diagram from a Java project?

In the Project tool window, right-click a package for which you want to create a diagram and select Diagrams | Show Diagram Ctrl+Alt+Shift+U ). In the list that opens, select Java Class Diagram. IntelliJ IDEA generates a UML diagram for classes and their dependencies.

How do you create a class diagram automatically?

To build a class diagram, all you have to do is launch the Smartdraw's Automatic Class Diagram extension and point it at your repository. Load your source code and choose which files you want to include in your diagram. Click "Build Diagram" and you're done.

Can IntelliJ generate class diagram?

IntelliJ IDEA Ultimate allows you to generate UML diagrams. You can use ⌥⇧⌘U (macOS) or Ctrl+Alt+Shift+U (Windows/Linux) to generate a UML diagram for your code which can help you and your team to read and understand the codebase.


2 Answers

This answer is framework-specific, but I'm working on adding support for this tool in doctrine/common, so if you are using symfony or CI or other frameworks, this may also be available soon.

If you are using Zend Framework 2.1 (as I'm writing) and follow my tutorial on installing Doctrine 2 ORM with ZF2, the developer toolbar will give you the ability to generate a diagram of all the entities with their relations, as of following picture:

UML diagram generated from Doctrine 2 ORM mappings via DoctrineModule

The tool is not yet perfect, but you may find it and help improve it in DoctrineORMModule.

like image 128
Ocramius Avatar answered Oct 16 '22 02:10

Ocramius


Try ORM Designer. You can import annotations and get the visual model. This model can be exported to PDF or PNG file.

In addition you can also edit your schema files visually, and then continuously export your definitions back to your code.

This is how model looks like: Example of ORM Designer model

like image 27
Ludek Vodicka Avatar answered Oct 16 '22 01:10

Ludek Vodicka