Visualizing Java project - java

I have been tasked with porting a large Java codebase to the Android platform. The project makes extensive use of AWT which isn't' supported on Android.
I'm looking for a tool that lets me visualize all of the classes in the project. I'd like to be able to see all of the relationships between classes so that I can get a good idea of where to start the port.
If you have any suggestions that would help in this task I'd like to hear about them.

I use Structure101 almost daily to visualize and understand our code base. A great tool and quite reasonably priced too.
This question has been touched at StackOverflow many times before and here are some links:
Is there some tool to visualize java class hierarchies and relations?
Tool to visualize code flow in Java?
Recommended Eclipse plugins to generate UML from Java code
Good free UML tool for Java/Eclipse?
IntelliJ IDEA also has some tools to help, like Graphical Navigator in IDEA 8 and Code Navigator plugin.

Netbeans has an OK reverse engineering tool which spits out a heaps of UML. I haven't used it in a while, but when I did it was a tad buggy.

There is an Eclipse plugin called Creole which you could also try. http://www.thechiselgroup.com/creole

Related

Get the class structure of an android project

I've an android project opensource written in Java (Eclipse). There are about 300 classes..I wanna to be able to understand the code quicker and to have a general representation of all the classes, interfaces and to know how they are connected each other.
Is there a way in Eclips or an external utility that could help retrieve the class structure of the project?
I have not tried it, but this looks good: http://sourceforge.net/projects/jug/
EDIT: Well this one looks even better: http://www.objectaid.com/home
EDIT 2: See this, too: http://www.nwiresoftware.com/
I haven't done that yet with Java, but you can try some of the options discussed here:
How to generate UML diagrams (especially sequence diagrams) from Java code
to get UML diagrams of your code
There are quite a few UML plugins available out there for Eclipse. It's really about how much information you want and which you feel comfortable with. The most popular one I found is Object Aid but a quick Google search for UML plugins for Eclipse returns a number of options.
If you want detailed UML diagrams then I highly recommend taking a look at Enterprise Architect. It provides tight integration with Eclipse. The desktop version is quite affordable.

Is it possible to have real time collaboration in an online IDE?

I am actually trying to create a browser based IDE for educational purpose to code java language programs. I want it to be something like eclipse orion except that the IDE will be capable of compiling and debugging java language code (and it will be only a bare bones IDE). And also, I want to add real time collaboration to at least the editor part of the IDE.
Would it be possible to create an online IDE that would have real time collaboration like the google docs? Also, is MobWrite one of the ways of achieving it and is it good?
If it is possible, please inform me.
Thank you very much in advance.
I think there is an interesting option out there by IBM(Just rode in a blog),
called "Web Browser-Based Interaction with the Eclipse IDE".
Have a look at this link:
http://www.rodenas.org/blog/2007/10/16/eclifox-web-browser-based-interaction-with-the-eclipse-ide/
So the answer is yes, it is possible somehow.
I hope it helps.
Update:
There is a similar question already on that topic(but browser interaction with the IDE is not mentioned), have a look at it, maybe can be helpful:
Real-time collaboration in Eclipse
In theory, anything is possible.
In practice, I'm not sure that collaborative programming ... where lots of people are hacking on the same files in real time ... is going to be productive.
Programs are qualitatively different to text / markup documents. When you two people are simultaneously editing a program, semantically conflicting edits can break the "work" in a far more fundamental way than conflicting edits on a document. I don't see this being an effective way to write programs.
Sure, JavaWIDE is what you are looking for: http://www.javawide.org
It has concurrent editing, and you can compile and run directly in the browser.
JavaWIDE is free and sites are available to educational institutions.
Feel free to try it out (no account needed) at http://sandbox.javawide.org
Cloud9 IDE has multi-language support has recently released a new collaborative tools including a new real-time collaborative editing feature (with authorship info), Group Chat and File Revision History timeslider. Further explained in https://c9.io/site/blog/2013/10/new-collaboration/
Mostafa,
The Cloud9 IDE Developer behind that Collab
It depends on the purpose of the IDE. JavaWIDE provides a great IDE for introducing programming concepts for novice programmers at the beginning of their programming classes. JavaWIDE will probably never be used for professional programmers.
Koding has a real time collaboration tool (with a bunch of cool stuff) where you can import your projects really easy. It also has a free VM with root access. Definitely worth checking out. :)
I recently saw Compilr and It seems pretty decent. You can run it inside a browser, full collaboration work is supported and Its cross browser and you can run it on your devices as well.
Nice thing is that it also includes some basic courses for you to learn coding which is exactly what you are looking for :)
For an on-premise install (you don't depend on external servers/services ) you could try Eclipse + saros (http://www.saros-project.org/), saros depends only on XMPP but you could build your own server locally (http://www.igniterealtime.org/projects/openfire/)
For web based collaboration tool on-premise too I've been developing this: https://github.com/juanitomint/Space_Editor
It's based on nodejs,Extjs,ace editor and git, contributors are welcome

Generating Class Diagram

HI All I am at the end of the release of my project.So in order to keep working our manager asked us to generate Class Diagrams for the code we had written.Its medium project with 3500 java files .So I think we need to generate class diagrams.First I need to know how reverse engineering works here. Also I looked for some tools in Google(Green, Violet) but not sure
whether they are of any help.Please suggest me how to proceed.Also a good beginning tutorial is appreciated.
I strongly recommend BOUML. Its Java reverse support is absolutely ROCK SOLID.
BOUML has many other advanteges:
it is extremely fast (fastest UML tool ever created, check out benchmarks),
has rock solid C++, Java, PHP and others import support,
it is multiplatform (Linux, Windows, other OSes),
has a great SVG export support, which is important, because viewing large graphs in vector format, which scales fast in e.g. Firefox, is very convenient (you can quickly switch between "birds eye" view and class detail view),
it is full featured, impressively intensively developed (look at development history, it's hard to believe that such fast progress is possible).
supports plugins, has modular architecture (this allows user contributions, looks like BOUML community is forming up)
The tool you want to use is Doxygen. It's similar to Javadoc, but works across multiple languages. If figures out the dependencies, and can call graphviz to render the class diagrams. Here's an example of a few Java classes run through Doxygen.
This is more a toolchain than a tool and I haven't tried it out myself. But it maybe a starting point. Using UMLGraph, ant and GraphViz. Explained step by step: in this article.
I ve used Visual Paradigm for UML for what you want to do and it was quite good.
See here for details.
Just go Tools -> Instant reverse and select your packages.
You may be able to reverse engineer class diagrams with the open source modelleing tool ArgoUML http://argouml.tigris.org/
ObjectAid is pretty nice. You can drag classes into a diagram and arrange them the way you want.
Visual Paradigm for UML Standard Edition (or Better) will reverse engineer Java files in to Class Diagrams.
I guess if your boss just wants to keep you busy until the next project starts then there's no harm in it, but you will find pretty quickly that creating a class diagram with 3500 classes will tell you exactly NOTHING about your system. In fact, you don't really want a diagram with more than about 10 classes on it. So once you have reversed all the code into your modelling tool, you will want to start organizing and arranging to find the meaning. Create a new diagram, drop a single important class onto it and bring in all the classes that are directly related to that class. Repeat for maybe the 300 most significant classes. Don't worry, it isn't as horrible as it sounds, maybe a week's work.
For the record, my modelling tool of choice is Enterprise Architect by Sparx Systems. It will reverse java sources or .jar files. There is a free 30 day trial edition.
There are some tools available that will help you generate these diagrams. These cost money.
Otherwise you could to try to parse your Java files. This could be as simple to create a simple parser that reads the Java files and writes the name of the class and all the import statements to a file and generates a class diagram from there, graphviz can help you there.
I've been using Enterprise Architect for a number of years. A JBoss developer suggested it to me. It works very well for all types of UML modeling including the reverse engineering of class models (Java, C# and others). The basic version is currently $120 per seat, but it has most of the capabilities of much more expensive tools and it is much easier to learn. I particularly like its ability to generate HTML and RTF documentation.
It is very easy to synchronize code between the tool and your source code. Even bi-directional if you want.
Your PM may also like the activity and sequence diagrams that it can create. I also frequently use the deployment diagrams. It's very helpful to have all of this in one tool.

Has anyone used "GWT Designer"?

Haven't seen anything about it here but it seems to solve one of the problems with GWT - the fact that you have to write Java code to generate your GUI. Instead this software allows you to design the GUI using drag-and-drop tools - a WYSIWYG interface.
I'm not trying to sell the product, by the way.
I just want to know whether it works as advertised, is effective, easy to use, etc?
Anyone have any experience to answer these questions?
GWT-Designer is now freely available as the product has been acquired by Google. http://googlewebtoolkit.blogspot.com/2010/09/google-relaunches-instantiations.html
Google will improve the product which is already quite good.
I don't think that the lack of a GUI editor is a problem with GWT. Consider HTML, there are plenty of WYSIWYG editors for that (like Dreamweaver) but most experienced web designers don't touch that stuff with a barge pole, they hand code it. Not because they're masochists, but because they want control over the source, they want to make it clean and readable. Coding is a scientific artwork, best left to Human Beings ;)
I tried GWT Designer very early on, and I found that it was fairly poor (and only worked on Windows because it had some dlls that went along with it), but things may have changed drastically since then.
I'm using GWT Designer for my Capstone project. I did start from scratch, and it worked quite well. I'm no fan of WYSIWYG software, so I was pleasantly surprised. Here's a link to a post I did on it:
http://benarchie.blogspot.com/2010/12/gwt-designer.html
GWT-Designer is getting better all the time. Give it another look some time, it's catching up to things like visual studio in my opinion.
Personally I like GWT Designer for Eclipse and it is free.
It is a rapid development tool. Not a solution for non-programmers however it will accelerate a Java coders ability to learn how to use the GWT API. Once you learn the tool it will reduce coding time.
I found it necessary to frequently switch between code and WYSIWYG editor to get things exactly how I wanted them. The two editors work well together. You will still need to refer to Java Docs to gain a full understanding. Most of the Java Docs have excellent Java and UiBinder code examples in them which are ready to cut and paste.
Creating GUIs in UiBinder is definitely the way to go because it simplifies the hierarchical nature of laying out GUI elements. The API is missing some information about how to hand code in UiBinder however between GWT-Designer, Java Docs and Google, you will find an answer.
The built in Jetty web server also simplifies deploying and testing on your local machine. I was able to make small code changes and see the effect in the web browser immediately.
Try these tutorials.
http://code.google.com/eclipse/docs/gwt_uibinder.html
http://code.google.com/webtoolkit/tools/gwtdesigner/tutorials/stockwatcher.html
I've tried GWT Designer recently. It still looks poor. If you don't want to lose flexibility, I would recommend to use GWTLab
Just tried it then. Most of my ui.xml files wouldn't open because it doesn't currently support #UiField(provided=true).
The ui.xml files that didn't use this feature would often crash with things like UnableToCompleteException.
Maybe if you started from scratch using designer you might have more luck.
I had a year's subscription but did not renew it, being a bit disappointed with the product.
1) The designer injects all Java code adding creation/property setting/event handling to the module you are building in a most unecomic way. Additionally, it is pretty difficult to modularize the application. Compared to Flex, for instance, the number of lines of code gets easily double or triple in a module and seeing the forest from the trees is not easy.
2) Web applications I built only a a couple of years ago CEASED WORKING possibly due to changes in Javascript engines. That was something I did not expect and is very possibly GWT's fault.
3) The GUI designer needs A LOT of CPU power and so does the build phase.
The concept is nice, however, I admit and GWT designer is the only of its kind. The feeling of difficulty in modularizing may well be my lazyness.
EDIT: Shortly after I wrote the above comment Instantiations/Google introduced the UiBinder concept which makes a lot more sense than the original amalgamation. Now it is a lot more professional.

Does anyone have any experiences with Eclipse GMF?

I've just started to play around with Eclipse GMF.
Has anyone used the framework?
Any good or bad experiences you had using it?
Any alternatives for graphical modeling you could suggest?
EDIT: What good examples are available?
Has anyone used the framework? Yes, I am using it right now. It works, but it is typically quite a bit of coding for the graphical figures. I currently am struggling to leverage the IBM RSA/RSM UML editparts/figures/nodes etc built on top of GMF.
Any good or bad experiences you made using it? Looking back on my initial dives into GMF/EMF/GEF etc I can say for certain, study the examples. There are important patterns that you have to pick-up on from the examples and not the documentation. I would also suggest a new book (Eclipse Modeling Project: A Domain-Specific Language (DSL)) specific for GMF Modeling in Eclipse. I paged through it and it seemed to be the missing manual to some of the more basic concepts. Why the book is good is that is focuses on the key to making UML/Models useful through constraining it to a specific domain and providing a tool that only allows for valid models to be created. There is not a lot of documentation online and the API only tells you so much. WATCH OUT for repaint/paint loops caused by calling setBounds() or other set methods on children, it crashes the eclipse instance, not fun. Oh yes and the APIs are split between eclipse help documentation versions or not included at all.
Any alternatives for graphical modeling you could suggest?
Consider UML profiles with custom images and icons rather than full shape generation. It takes about 2 hours to put together a pretty good Image/Icon editor building on top of UML graphical objects and UML profiles. The IBM RSM tool UML Profile tooling project does this quickly. There is a lot you can do with constrained UML profiles (via Eclipse plug-ins or OCL). Entering GMF land is more than a order of magnitude effort increase, from 1 to 10 hours no problem.
Consider pure DSL (Domain specific language) tools out there. Google will provide a good list. From what I have seen the main reason to use GMF is eclipse integration and leveraging existing ecore/UML models, this is why I use GMF.
Ask yourself do I need model which is easy, or do I need a tool for creating instances of this model. If there are only 1-5 expert users there may not be a need for a sleek tool.
The TOPCASED project makes use of GMF. It provides various graphical editors for UML and other diagrams.
With GMF, most of the editor code is generated for you, but the main complexity arises from having to modify it.
As most recent alternatives, you might try Graphiti and Spray. Here is a comparison and another between GMF and Graphiti.

Categories

Resources