Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is there a Java API/Library that I can use to generate UML diagrams (Class, Sequence and Package)? I want to be able to embed the diagrams within my Java Application.
If you build your application on the NetBeans platform (or at least using Swing), you should be able to use the NetBeans UML plugin. Pay attention to the licencing (although I don't expect problems there) and NetBeans versions (the UML plugin isn't available for all NetBeans versions).
If you're building on Eclipse RCP, you could use the UML2 plugin.
You may try TextUML Toolkit which is able to represent UML model in textual notation and transform it to Graphviz read-only diagram. I believe (since I have no particular experience with the toolkit) it accepts also model in Eclipse EMF UML2 meta-model (which is one of its dependencies), so you could instantiate the UML model programatically.
There will be quite a bunch Eclipse EMF-related plugins dependencies. Learning curve won't be very flat (providing you have no former experience with Eclipse EMF), but drawing a UML diagram is not exactly a one-liner:)
You can have a look at this french tutorial I found on UMLGraph: http://rpouiller.developpez.com/tutoriels/java/generation-diagrammes-uml-avec-umlgraph/
For english translation I used google: http://translate.google.co.uk/translate?u=http%3A%2F%2Frpouiller.developpez.com%2Ftutoriels%2Fjava%2Fgeneration-diagrammes-uml-avec-umlgraph%2F&sl=fr&tl=en&hl=&ie=UTF-8
You have today two options today in modeling which are either to show static diagrams at any stage of your implementation code (e.g. UMLGraph or other plugins) or to use the model driven development (e.g. UML tools). All depends on the need.
I would not personally recommend only using Java graphical libraries because this is not UML. I mean that UML is composed by diagrams and a model. Graphical libraries such as UMLGraph just give you a graphical view of a package. This is like a pdf reader which is not sufficient as soon as you need to create your own pdf and share it with other users. I also don't see any interest just showing static diagram because this information is usually already available in the project tree view. I mean that you see classes and inners classes. Inheritances are visible in the first line of each class so really easy to see. Concerning associations and dependencies all this graphical libraries can not detect them or just basic links, or even wrong associations therefore you can't use associations or dependencies links with graphical java libraries. I mean that the java detection is very simple and therefore limited.
You will never be able with graphical libraries to display all java information inside an UML class diagram because only 50% of the project would be displayed. If you have a lot of methods and attributes then your diagram would be so big that you will not be able to display the diagram on one page. You need advanced feature like show hide compartments, re-size etc which are only available inside traditional modeling tools.
I think that showing static UML class diagrams which only have 50% of the real java project information, are not visible by human eyes because bigger than a page, have no model and are programmatically generated by maven for example have no project value. The only value i see is psychological for the project manager showing diagrams with no sense for presentation purposes to end users who don't know what means UML modeling but believe they do know !!
See the nice standalone argouml application which should have some capabilities to display uml :-)
Related
This question already has answers here:
Generate UML Class Diagram from Java Project [closed]
(4 answers)
Closed 9 years ago.
I want a tool which will see my java code or eclipse java project and convert it into diagrams which show relations and dependencies between classes and methods. Such a tool would greatly reduce the need to explain my code to others. It will make the relevant diagrams/pictures which are much easier to understand than only comments and java
docs.
Are there any reliable tools for such purposes ? I prefer free/open source tools. But, anything is okay as long as its accepted by the industry.
EDIT
I need all possible diagrams that one can think of - UML, Sequence, State, Interaction, Show which method calls which, etc. Its not a problem if each functionality is provided by a different tool. I can use multiple tools to generate different types of diagrams.
I think what you're looking for are class diagrams. If you don't know what UML is, you definitely need to take a look at it.
The question of generating class diagram with Eclipse has been extensively covered on SO, here are good pointers for Eclipse plugins.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I need to maintain some project in Java, but it is very big. I need some plugin for Eclipse or program alone which can generate UML from Java project. Is there something what can help me ?
Visual Paradigm for UML
Tools --> Instant Reverse --> Java --> Specify your sources and you are done.
This is a commercial application with lots of stuff, but for what you need to do, you are fine with the evaluation key.
EDIT: Also have a look at this video
This has been asked before.. please find it at
How to generate UML diagrams (especially sequence diagrams) from Java code
I recommend Architexa for its great class digram generation. Instead of generating every classes in a huge class diagram, Arhitexa allows you to selectively display the relevant classes in the diagram.
Most UML tools can import Java code. Last time I used JUDE Community edition it could do it, but they've split it into community and paid editions. I'm not sure if the free one does anymore. Sparx Enterprise Architect can import Java as well.
Umbrello supports Java code import, and it is open source, so will cost you nothing to try.
You might also give Doxygen(with GraphViz) a go; it will generate UML 'style' class diagrams and is a great code navigation tool for unfamiliar code-bases. Not truly a UML tool though, but might suit your requirements.
I suggest euml2 as an eclipse pluggin.
It has a free version and it is quite good!
I recommend Enterprise Architect which supports full reverse and forward engineering including for Java. Automatic Documentation generation as Word, PDF or website.
Free Class Visualizer does exactly that - you load compiled Java code and, as a result, receive class diagrams allowing you to navigate through relations.
It supports parametrized types, annotations and discovers all sort of outbound and inbound relations (including dependencies).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Can anyone help me? I am currently using Eclipse Java IDE, and would like a plug-in that will automatically look at my classes and draw up a class diagram in UML.
Any suggestions?
I recommend the ObjectAid UML plugin. It works very nicely.
The challenge in what you are trying to do is that you can have multiple correct UML diagrams for any piece of code. Just trying to automatically get a diagram ends up with too much garbage when using most UML tools - and the tools just end up getting in the way.
We created Architexa to help in this situation - Architexa helps you to get to useful diagrams fast - if that means connecting to source code commits or even building layered architectural diagrams. A good discussion on some of the things that you might be looking for can be found here.
Try UML2 from Eclipse Modeling Tools. Here's also a tutorial.
Even if a bit too late for the original questioner, maybe following eclipse plugin does match the need of real time analysis:
http://marketplace.eclipse.org/content/javadoc-uml-view
This tool is highly intended for analysis purposes and less for diagram modeling. So if you want to draw diagrams manually its not the right one, in this case ObjectAid UML explorer is far better.
Just to be mentioned :-)
One more option: http://www.modelgoon.org/
It's a very simple one, but it's still an active project.
Try using Omondo. Its a very nice UML plugin for eclipse. It will exactly suit your needs
I would try MoDisco http://www.eclipse.org/gmt/modisco/. It is an extensible framework for software modernization.
You may try architexa tool suite. It generates not only class/sequence diagrams but also layered diagrams. You may read about it here.
Check this out, this designer is free (Open Source with EPL license).
UML Designer which can be used for:
Package Hierarchy
Class Diagam
Component Diagram
Composite Structure Diagram
Deployment Diagram
Use Case Diagram
Activity Diagram
State Machine
Sequence Diagram
Profile Diagram
Got good tutorial as well:
http://www.umldesigner.org/tutorials/tuto-getting-started.html
If you can move to IntelliJ they have a wonderful plugin for that.
If you're "stuck" with eclipse... AmaterasUML is good enough - I've used it in the past...
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
This seemed to me like the easiest thing to find, a simple way to display my classes as UML in eclipse
But except this: http://java2uml.gforge.enseeiht.fr/ and this http://sourceforge.jp/projects/amateras/releases/ I haven't found any new, maintained and "good" implementation (with all due respect to the above two)
Anything else I've missed?
Did you consider
Creating UML 2 diagrams with Eclipse UML2 Tools - Tutorial ?
I had older references for such tools, but the new ones are build upon UML2 project (described in the tutorial). MDT-UML2Tools is in the making, Omondo is there, but not free.
Papyrus UML, for instance, is based on UML2 Tool.
There is a tool in the Marketplace that can do the above (UML Class, Package and Interaction). It's called ModelGoon. Last tried in July 2018.
The full list is available at Eclipse marketplace.
If you want to stay within Eclipse: use free ObjectAid - discovers parents, nestings, associations.
If you want the tool, which in addition discovers and show children, usages, dependencies, annotations - then use free Class Visualizer.
I generally use Doxygen to create documentation because it has built-in support to generate inheritance diagrams. There is an Eclipse plug-in for Doxygen called eclox. It is not longer maintained since December 1st.
Doxygen is based on Graphviz. You could directly use LightUML, which is based on Graphviz to create UML diagrams in Eclipse.
Annotate your classes with Ecore's annotations, then you can import an Ecore file from them. You can initialize an Ecore diagram from them, or export it to UML, and initialize a class diagram from it.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
We're trying to determine how to implement a simple plugin framework for a service we are implementing that allows different types of calculators to be "plugged-in".
After reading a number of posts about Java plugin frameworks, it seems like the most common options are:
OSGI
"Rolling your own" plugin framework
The Java Plugin Framework (JPF)
The Java Simple Plugin Framework (JSPF)
OSGI seems to be more than we need.
"Rolling your own" is ok but it would be nice to reuse a common library.
So we're down to the JPF and JSPF. JPF doesn't seem to be in active development anymore.
JSPF seems very simple and really all we need. However I haven't heard much about it. I've only seen one post on StackOverflow about it. Does anyone else have any experience with JSPF? Or any other comments on this design choice?
Update: There isn't necessarily a correct answer to this.. however we're going to go with Pavol's idea as we need just a really, really simple solution. Thanks EoH for the nice guide.
(Disclaimer: I am the author of JSPF, so better take my comment with a grain of salt ;-)
The main reason I started with the JSPF was because I had the same problem as you have now: I was looking for a simple solution to make my thesis-project 1) extensible and 2) give it a more or less clear code structure.
The reason why I haven't decided to use an existing framework was because most of them were so heavyweight to start with, that I got lost in reading documentation and was almost forgetting my original task. So, according to your statement
We're trying to determine how to
implement a simple plugin framework
for a service we are implementing that
allows different types of calculators
to be "plugged-in".
I'd think that you could give JSPF a shot and see how far you come within one or two hours.
However, the final decision also depends a bit on what exactly you want to achieve, and the specific circumstances.
I have heard positive results from a number of individuals who have been using it to structure their projects or load plugins in their projects. On the other hand, I also know of one person in our department who discarded it again because he didn't feel it was mixing well with his programming style.
So, to answer your question briefly (and surely in a biased way), I would use
OSGi for projects and teams
which are large and have many people working on it
that justify the overhead of setting up the infrastructure
in need of the specific services offered
JPF for projects and teams
of medium size (?, honestly I am not sure about the project / team size they are targeting)
which are in need of more structured facilities to organize their code, like XML configurations, detailed plugin lifecycle management, extensible plugins ...
JSPF for projects and teams
of small size, following an agile paradigm
that just need something that works out of the box, without the need of configurations or setup
willing to sacrifice some features for simplicity
I hope you find the plugin framework most suitable for your scenario. And, no matter what you try, I would be happy to hear about your results.
If you are planning to have just one (or only a few) not very complex 'extension points' than perhaps a well-defined SPI and a piece of configuration might be sufficient. No need to use a plugin framework.
By piece of configuration I mean some mechanism to find your plugins. For example something like META-INF/services/ or simply listing your plugins in a configuration file.
More details (upon request):
SPI = Service Provider Interface, an "implementer-side equivalent of an API". To learn more try searching for a difference between API and SPI. However in this context it is just a fancy term for an interface to be implemented by your plugins (i.e. defines the contract for your plugins).
A nice, short article "Creating a Service Provider Interface" by Ethan Nicholas describes how to create your own SPI in similar way as it is done in several part of the Java Platform itself.
META-INF/services/ can be seen as a more generalized approach to creating SPIs. More information can be found in the respective section of the JAR File Specification.
If you need a really simple solution, try jin-plugin. It is a minimalistic plugin framework for Java and PHP.