Where to find Java API Class diagrams? - java

Is there a site where we can find JAVA API class diagrams.
It helps to be able to see the class hierarchy (example Exception class hierarchy) in a visual manner.
Thanks.

This might not be as visual as you like, but the hierarchy can be seen in the official Java docs.

If your are asking for class hierarchy in general, found this one on Javase docs

There's nothing pre-built that I know of. If you're using an IDE (Eclipse, NetBeans, Intelli-J, etc.) it almost certainly has a built-in class hierarchy browser.
That said, the online JavaDocs do have a text-based class hierarchy for every single class. As per your example, here's what it shows for Exception:

http://docs.oracle.com/javase/7/docs/api/overview-tree.html though it is not uml,but i think it is clear
althoug there is not api uml,we can look api tree

i was looking for it too, i found this germany website click here.
That site represents all class diagrams and also provided you 223 pdf files with those diagrams.
The problem is the java version (java 1.4) but it still very helpful to me.

I have recently started adding such Class diagrams along with the class lists based on search criteria on my blog. Here are few samples -
http://www.buggybread.com/2015/09/java-class-diagram-collections-classes.html
http://www.buggybread.com/2015/10/java-javaio-stream-classes.html
http://www.buggybread.com/2015/10/java-se-list-of-algorithm-classes-and.html
http://www.buggybread.com/2015/10/java-se-javalang-string-classes.html
http://www.buggybread.com/2015/10/class-diagram-java-se-javautil-map_2.html
I haven't added lot of such material for Java SE and it's still not linked and indexed properly. Still you can search either on website or on google by adding the site name to your search. Thanks.

Related

How to make use of Java's Graph Class?

So this is definitely a simple problem most likely with a simple fix but I just cannot figure out the issue here.
I am trying to make use of Java's Graph class:
http://docs.oracle.com/cd/E12839_01/apirefs.1111/e13403/javax/ide/util/Graph.html
however, I am unable to import javax.ide. There are many other packages/methods beginning with javax. that I am able to import as displayed in eclipse but javax.ide is not one of them:
I am, however, able to import java.util.AbstractCollection but my program still cannot resolve Graph to a type when I do this.
My guess is that the class is simply not in the library, I have tried updating my JDK but it doesn't seem to have changed anything. I apologize for my ignorance here, any help is much appreciated.
javax.ide.util is not part of the standard JDK. The link in the question takes you to an Oracle Fusion Middleware API subsection, which includes IDE API (JSR-198). You need to install additional libraries (probably Oracle Fusion Middleware) to get this package, but that would be an overkill to just get a graph library. It's better to evaluate your requirement and see what graph library suits your needs.

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.

developing decomplier for java byte code or from class diagram

iam planning to develope one application, which will take java byte code or class diagram or metamodel as an input and produces the source code according to package structure.
But i need some suggestions like,
How to start this application, mean do there any api that convert the metamodel or byte code to source code.
You can check with Jdec framework in that case.It is doing the following functionality:
Selective Decompilation of a class file
Disassembling a java class
It is open source.
http://jdec.sourceforge.net/
I think it might be a good start.
Not sure if BCEL is what you are looking for but it's worth taking a look.
When I personally need to decompile some java bytecode I'm using JAD.
Also when you're looking for an general introduction to java bytecode for an better understanding try the two links in the comments (I'm restricted to two links per answer so I apologize the inconvenience).

How to understand Open Source projects/libraries?

There are few open source projects/APIs/libraries that we use in our project (Spring, Struts, iBatis etc.) and I want to understand their design and how they work internally.
What is the best way to understand these projects? Note that I am already using these libraries in my project. And I know the input-output interaction/configurations for these libraries. What I don't understand is how these APIs/libraries work internally.
The problems I face is:
Finding the entry class of the library. Is there any way I can know the entry class for the library - something which is kicking the whole API?
Tools/Plugins to use in Eclipse to get an overview of the design of the library. Going through each and every class of the library, can be a very daunting task. Is there any tool you would like to recommend which can generate the class diagrams of the API in Eclipse.
Thanks in advance!!
UPDATE: I need some inputs on eclipse plugins which can help me in getting an overview/class diagram of the library
I always use the same strategy for this: I never try to "understand" the code base as a whole, and I usually try to follow the request flow. I read enough of the documentation to determine what is necessary to use the application, and I read that code (Keep all source code loaded in your IDE).
For example, in struts you'll be installing a servlet filter in web.xml. Start reading the filter and follow the path a single request takes through your stack.
Likewise for spring, there are two main entry points, the filter and "getBean", both of which are mentioned real early in the documentation. Read those two.
For both of these cases you'll find one or two classes that represent the "core" of the framework real quickly. Read those really well and let actual use cases & needs drive your further exploration.
Approaching "understanding" of an open source library (or any other code base for that matter) by trying to find all the pieces is usually not a very good way of approaching these things, it will usually just lead nowhere because a lot of these things contain too much code. When following the request flow I find making diagrams can also be quite distracting, it tends to draw attention/focus away from understanding (and since my understanding increases rapidly most of them are out-of-date even before they reach the printer).
Nice question!!!, what I've done, specially in the case of Spring, apart from consulting the Documentation and their API's is to attach the sources of the project to my project on Eclipse, that way I'm able to navigate through the source code, not just the API. Its been quite helpful specially in the case of the Spring-Security project, there were some concepts that I just couldn't understand until I inspected the source code.
That's one of the advantages of using Open Source libraries.
Regards.
Tools like Structure101 (http://www.headwaysoftware.com/products/structure101/index.php), and Lattix (http://www.lattix.com/) let you analyze code and produce architecture diagrams / dependency matrices.
This is not exactly class diagram - the main focus is on layering. So the entry point is usually the topmost layer.
But then again, as I specified above, you will notice that some libs are just a mess, and these tools will not be helpful enough.
See the S101 online demo: http://www.structure101.com/java/
This for example is the Sonar project architecture: http://www.structure101.com/java/tracker/sonar/1.11.1/arch.html
Your best bet for those three would be to consult the official documentation (make sure you are looking at the version you are using) or to get a book on the technology.
Most APIs don't have a class with a main method; they're running in the webserver called by the server itself. Unless they're running as their own server, they won't have a main method.

Any Latent Semantic Indexing?

Is there any open source implementation of LSI in Java? I want to use that library for my project. I have seen jLSI but it implements some other model of LSI. I want a standard model.
Have you considered LDA (Latent Dirichlet allocation)? I haven't really either, but I encountered the same problem with LSI recently (patents). From what I understand LDA is a related/more powerful technique. http://en.wikipedia.org/wiki/Latent_Dirichlet_allocation apparently has some links to open-source implementations.
A google search for java LSI leads to a similar question that recommends SemanticVectors. A package built on top of Lucene that is 'similar' to LSI. I don't know if it's closer than the jLSI implementation.
That thread also mentions that LSI is patented and there aren't a lot of implementations of it. So if you need a standard implementation you may have to use a language other than java.
The S-Space Package has an open source version of LSA, with bindings for the LSI document vectors. (Both approaches operate on the same term-document matrix and are equivalent except in the output.) It's a fairly scalable approach that uses the thin-SVD. I've used it to run LSI on all of Wikipedia with no issue (after removing the infrequent terms with less than 5 occurrences).
As Scott Ray mentioned, the SemanticVectors package also has a good LSI implementation that recently switched to using the same thin-SVD (SVDLIBJ), so you might check that out as if you hadn't before.
a google search for NLP tools provide this slides which i think helps ...
I believe that LSA/LSI was patented in 1989, which means the patent should have just expired. Hopefully we will see some nice open source applications soon.
Have you tried the Semantic Vector package?
http://code.google.com/p/semanticvectors/

Categories

Resources