0

What is the best way to document Java sources in UML? I know class diagrams, package diagrams and object diagram. What else should be documented? And is there any recommendation for a tool to support documentation?

5
  • I don't understand your question. "UML from java code" does mean what? Use Java to create UML (diagrams)? Commented Mar 30, 2015 at 16:56
  • sorry for my english, i want make diagrams from java code, what any diagrams can i make from java code, i need guide reference for my work. Commented Apr 1, 2015 at 1:19
  • So you're trying to reverse engineer your Java code to get an UML model out of it? Commented Apr 1, 2015 at 7:34
  • 1
    I removed relation diagram from your question since there is no such diagram. Go for @xmojmr's answer. I guess GenMyModel is also worth a try. Commented Apr 1, 2015 at 7:46
  • oh thanks for revision. yes, i think there is a best way. Commented Apr 1, 2015 at 9:08

2 Answers 2

2

Use an UML modeling tool with some kind of code reverse engineering support so that it can create some basic diagrams automatically from your existing code.

Creation of the rest requires manual work and some imagination and some thinking on your side. There's no magic tool. That would be your task/work/effort.

To find out what might the "UML beside classes..." browse through

Sign up to request clarification or add additional context in comments.

12 Comments

no, i need make it manually, i want to know what any diagrams can i make from java code, and rules making for each of these diagram.
@uwong15 the uml-diagrams.org online book is probably the easiest UML book one can read and at the same time the most complete and up-to-date. To document your Java application, how does the code look ("structure diagrams") what does the code do ("behavior diagrams") and why ("use case diagram") you can use all of the available UML diagrams. For each diagram type the book contains examples, explaining chapter, drawing reference chapter and sometimes some discussion and historical background. After you know what's possible with pencil & paper, get a good UML modeling tool...
@newbie I can somehow imagine what kind of Java code is hidden behind this class diagram example and this sequence diagram example. Both were drawn using "Microsoft Visio and UML 2.2 stencils" (not very rigorous/helpful UML tool). Pick an UML tool and read it's tutorials. It's probably the best I can advise you without seeing the real *.java code
@newbie in order to see how exactly should your manual result look like, you can use a tool like ObjectAid UML Explorer for Eclipse, feed it with your *.java files, see what the tool draws and do the same (or similar) thing manually. There are about 20 different types of UML diagrams and all of them can describe your real *.java code. Just start drawing and if you hit some concrete drawing obstacle related to some concrete piece of code then open another question
i have e-book in here link. i need more references to support my project please.
|
2

From Java code, you can get the class diagram including relationships (relation diagram does not exist). Object diagram is for describing runtime instances.

If you have your Java code in a Git repository, you can get the corresponding UML model online using the GenMyModel reverse engineering feature (get started, documentation).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.