3

I have a Java code which I need to generate the class diagrams and sequence diagrams. I am using netbeans, but the code is 100% pure hand coded. How can I generate the class diagrams and sequence diagrams for existing code using netbeans?

The code is separated into packages, so I need to generate class diagrams package wise. Which means, for an example, diagram 1 for package 1, diagram 2 for package 2 etc. Finally I need to take the generated GUI as an image.

Please help!

PeakGen
  • 21,894
  • 86
  • 261
  • 463
  • have you looked at previous questions on this topic? for example - http://stackoverflow.com/questions/10146111/creating-uml-class-diagrams-in-netbeans-7-1-1 – radai Mar 23 '13 at 06:54

2 Answers2

3

IMO, generating UML diagrams for code that you have written yourself is kind of pointless. The value of UML is as a design aid and to a lesser extent as a reverse engineering aid. If you are intent on generating code documentation for existing well-understood code, Javadoc is probably better value than UML, and a lot less work.

The other problem is that generated UML class diagrams tend to be ugly because they tend to include more detail than is necessary, and because you need a human eye to lay things out decently. The same probably goes for sequence diagrams.

But if that hasn't convinced you, these links should help you do it.

(Disclaimer: scraped from this closed Question - UML automated generation for Netbeans 7.1)

Finally I need to take the generated GUI as an image.

Take a screen shot of the GUI using the tools provided by your OS.

Community
  • 1
  • 1
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • yaya, documenting..My university work. I need a detailed design, there are some parts which are nt in original highlevel GUI, but in code. SO I need reverse engineering. – PeakGen Mar 23 '13 at 08:18
  • @Yohan - I think they probably intended you to do it the other way around. Design using UML diagrams, then implement classes based on the diagrams. – Stephen C Mar 23 '13 at 11:30
2

I just created UML diagrams for my uni project . Sad to see that Netbeans has stopped supporting UML plugin for its newer versions. In case you are also on a newer version like me (7.3 ) then you can make use of a third party tool namely yWorks UML Doclet to generate UML .

Its works really well . At least i am happy . See the way to use it NetBeans 7.0 and 7.1 UML plugin

Hope this helps!

rockstar
  • 3,512
  • 6
  • 40
  • 63
  • does it generates sequence diagrams? Third party app also fine – PeakGen Mar 23 '13 at 14:53
  • yWorks seems to be pretty dangerous. Their license agreement says we need to keep their link in the output! That means, BUSTED! – PeakGen Mar 23 '13 at 14:58
  • @Yohan i dont really care if i should keep their link in their output . i can see that they use it to advertise their product . Its ok with me ! I comply to licenses ! – rockstar Mar 23 '13 at 16:24
  • @Yohan it doesnt seem to generate sequence diagrams. I am searching for one as well . Post here if you find something useful :-) – rockstar Mar 23 '13 at 16:26