Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij UML Diagrams

Tags:

I just noticed that Intellij has a UML diagram drawer. I am attempting to use it to figure out what is going on in some code that is new to me.

Is there anyway to show the dependencies between all of the classes/interfaces on the screen? Is this a useful feature? It seems to be missing somethings but it might just be that I am not that familiar with UML.

Anyone have any observations?


Is there anyway to show has-a relationships?

like image 440
sixtyfootersdude Avatar asked Jan 21 '10 18:01

sixtyfootersdude


2 Answers

You can manually add "has-a" relationships by right clicking on a class in the UML diagram, select "Show classes from signature" (or press Ctrl+Alt+U) and choose the class you want to add. Then you can select "Show dependencies" to let Intellij fill in the dependencies.

Tiny fabricated example (omitted the obvious empty definitions of A, B and I)

class Test implements I {
    List<A> a;
    B b;

    Test(A a, B b) {
        this.a = Arrays.asList(a);
        this.b= b;
    }
}

will result in the following diagram after adding A, B and "Show dependencies":

http://i33.tinypic.com/o8cw36.png (was not allowed to post the image as this is my first post :))

like image 92
Jens Hoffmann Avatar answered Oct 12 '22 05:10

Jens Hoffmann


I use Code Iris and PlantUML. It is a very useful tools especially PlantUML. Other tools of this type in the IDEA are paid. enter image description here enter image description here

Below PlantUML. enter image description here


I hope it will help you.

like image 32
Kas Elvirov Avatar answered Oct 12 '22 03:10

Kas Elvirov