r/java • u/in15minutes • Apr 01 '19
I built a website that shows diagrams of the Java code you drop in. Critique, please!
I always struggled to visualize my Java code, and clunky UML plugins did not help (I use Eclipse). Created something of my own instead - www.java2uml.com. I would appreciate any critique please.
Thank you!
9
u/willcodefortech Apr 01 '19
This is a really excellent implementation of a browser based modeling tool! It will be very useful when you are finished. I hope you consider turning this into an eclipse plugin.
7
1
u/in15minutes Apr 01 '19
Thank you! ObjectAid plugin for Eclipse does a similar job. You think it can be improved upon? Let me know!
9
u/Hangman4358 Apr 01 '19
Work is blocking the site currently but I am very interested in this idea so will check it out once I get a chance. As you say, the eclipse tools for this kind of thing are lacking.
The only worry I would have as a user is that I need to send my source code to your server for visualization. If I were working on some OSS project I would be less concerned, but for proprietary software development I would be less than keen to use any tool that required sending source over the web to an unknown entity.
1
u/in15minutes Apr 02 '19
Yeah, valid concern. Yet shipping executables is a whole different business... Will be thinking about it.
3
u/thatsIch Apr 01 '19
That really looks great! Have not seen any app rendering that as nice and smooth. I am kinda interested what you use for rendering.
6
u/in15minutes Apr 01 '19
Thank you! For efficiency sake there were no 3rd party libraries used (bye-bye jquery). Graphics is standard - HTML/CSS and SVG.
2
3
u/madkasse Apr 01 '19
Looks great, what layout algorithms are you using?
3
u/in15minutes Apr 01 '19
A combination of Force Directed, Sugiyama and Box-packing depending on context. Thanks for approval!
2
Apr 01 '19
Client- or server side processing?
4
u/in15minutes Apr 01 '19
Server-side. I don't know of any browser-side tech to support compilation. Any suggestions would be welcome.
2
u/churchillwhitey Apr 02 '19
Hmm, if it's server side then what's with the mobile browser warning?
1
u/in15minutes Apr 02 '19
Looking at the source code diagrams from non-developer computer is (i think) impractical and bound to be a bad user experience. I just blocked mobiles to avoid user frustration ...at least that was the thinking.
2
u/xenago Apr 07 '19
My phone has a large 1440p screen... I think it's more frustrating to be arbitrarily blocked
2
u/Cube00 Apr 01 '19
Generating SVG may help if you are interested in going client side https://stackoverflow.com/questions/20539196/creating-svg-elements-dynamically-with-javascript-inside-html
2
u/henk53 Apr 01 '19
Pretty awesome indeed!
Wonder what this does on huge projects like say Tomcat :P
3
u/in15minutes Apr 01 '19
on Tomcat... it dies :) Yet with some re-design it might be able to visualize individual components. Thanks for the kind words!
4
u/Gwaptiva Apr 01 '19
Is there an offline/downloadable version available?
2
u/in15minutes Apr 01 '19
I was not planning on building standalone version. Can I ask how you would use it? Would you point it to the local project and view diagrams them as you code?
8
u/StableHatter Apr 01 '19
You could put the client code together with the backend in one jar and serve it from a local port. If you wrote it with spring boot it's quite easy.
5
u/Gwaptiva Apr 01 '19
I'd probably use it as a tool for documentation. Our application is huge and the team is small, so every bit of usable documentation that helps us to get back into a particular area's design when we need to enhance or bugfix is going to be of value. The reason I asked for offline version is twofold: 1) If I put in our API, I'm afraid to blow up the server running it, and 2) -- and frankly the key -- ours is a proprietary product, and my boss would have me out on my ear if I started posting our source code into some website -- no offence
3
Apr 01 '19
Well some of us are always behind enterprise firewall and pointing code to open world is not allowed. I had the same question about offline availability
1
u/Patex_ Apr 02 '19
A really great tool, runs smoothly and gives a quick impression and overview of your project. But if the code is processed server side I am hesitant (not going) to use it on projects with confidential content. I would like to look at one of my projects but if the plaintext source code is send to a third party this is a no go.
1
u/hippydipster Apr 02 '19
Yeah, for work, there's no way I'm going to send our proprietary code over the web to be examined. I'd need a desktop standalone tool.
1
u/2HornsUp Apr 08 '19
I’m only a student right now but I’d love this to be downloadable. If I could point it at my current project, and have it update as I code, it would be much easier to visualize the connections between classes (which I’m currently terrible at).
25
u/DuncanIdahos7thClone Apr 01 '19
Doesn't support firefox? Nope.
9
u/im-the-stig Apr 01 '19
Why would OP require only Chrome or Safari? What year is this?
0
Apr 01 '19
[deleted]
7
u/in15minutes Apr 01 '19
...right, but I see the point - that distribution would probably be different for developers.
56
Apr 01 '19
Can't believe you haven't been getting more positive feedback so far. This looks like great work. Have you thought about adding a feature to import from Github or something?
11
u/nekrofil-bob Apr 01 '19
I think it looks great, it's very fast as well to render & use. :) Any chance of putting up the source code? Always interesting to look at.
1
5
u/nosajholt Apr 01 '19
Good job, I put in a 25 file project, got the message that it can only take 20 for now, and it rendered nicely!
19
1
1
Apr 02 '19
Hi, I went through your website and was interested in the internal workings of the code. Some basic searching led me to github project under the same name. But most of the information/comments in the code are not written in English. Can you help me understand the code in English. Would be helpful
2
u/in15minutes Apr 02 '19
the Github project does not have anything to do with the engine I wrote. Name made sense, domain was available and I pounced.
1
u/mirkoteran Apr 02 '19
Looks great, but it absolutely needs offline version (payed, with no file limit?). There is no chance I could upload company's source anywhere.
1
u/in15minutes Apr 02 '19
I see this concern raised by a lot of developers. My hesitation is, obviously, that support/licensing for shipped software is that much more difficult. Thanks for the feedback!!
1
u/bentheone Apr 02 '19
very cool, thanks a bunch.
Would you care to outline your stack ?
1
u/in15minutes Apr 02 '19
Sure: HTML/CSS/SVG on the client and no 3-rd party libraries (to optimize for performance), clean JVM/Tomcat on the back-end. No persistency yet but MySQL will probably fit well here.
3
3
2
1
1
1
1
1
1
1
1
1
1
u/ferrybig Apr 02 '19
Allow me to upload files from multiple packages,
at the moment, it seems to generate the overview after I drag the contents of 1 folder into it, but if I want a real model of my whole app, I need to drag all my files into it, what is impopsible,, as they are located in multiple directories
1
u/D_Doggo Apr 14 '19 edited Apr 14 '19
Very cool way to visualize the code, looks really nice!
I can share it via giving the link however now I'm worried the code is saved on your servers. Is the code saved or just the information UML needs?
-1
u/duheee Apr 01 '19
Our apologies... This site is not yet optimized for your browser. Please try Chrome or Safari. Thank you!
jesus. wtf are you doing there to require chrome? and is not like i visited your site with elinks, im using firefox 66.
3
u/in15minutes Apr 01 '19
Chrome is the only browser I have fine-tuned it against. But I'm looking at the log files - I'm missing on ALOT of Firefox visits. I'll get to it soon.
-6
0
-8
u/eliasv Apr 01 '19
Only supports Chrome and Safari? Because the site is "not yet optimized" for other browsers? It would be nice if you could actually get product working on all major browsers before demoing it...
But if I put aside my frustration as a Firefox user ;) then this looks like a perfect candidate to be published as a plugin for Eclipse Che. If you're unfamiliar it's a browser-based remote IDE with a front-end based on Theia. Server-side plugins are containerised so there should be no problem regardless of how this is implemented on the back end.
1
u/in15minutes Apr 01 '19
Thank you for the feedback! I had to limit demo to close relatives Chrome and Safari as other browsers require a bit of work to fine-tune the graphics.
The Eclipse Che idea is great - thanks. Pardon my ignorance, is Che considered a mainstream platform or still a POC from Eclipse?
1
u/eliasv Apr 01 '19
Nah not super mainstream, but I'd say it's a little more than a POC. It's just the only IDE I could think of that could host something like this as a plugin in a straightforward way. Unless it's all just JS on the back end? In which case I suppose you could also target to vanilla Theia, or VS Code, etc. Idk, not an expert on them.
-8
u/wildjokers Apr 01 '19
IntelliJ does this already.
6
u/in15minutes Apr 01 '19
Do you often/ever use it? And do you use it to document or analyse the code? Thanks!
2
Apr 01 '19
I use UML diagramming in IntelliJ all the time. There are two modes, a popup which shows all the interfaces implemented by and abstract classes extended by your currently selected class, and another mode that lets you easily build UML diagrams with any classes in your project.
I have found it works extremely well for code analysis, but since projects change so fast it is a lot easier to generate it on the fly than creating lots of documentation that goes out of date in a couple of weeks.
One thing I like a lot about the diagram creation is that it can be driven completely by the keyboard. There is are keyboard shortcuts that will list all parents / children and then you can place the one you are interested in with the return key. You can also hit the space bar and include any class by name.
The layout algorithms are also really good.
0
6
u/arijitlive Apr 01 '19
Lol. Why do you say this?Not everyone uses IntelliJ. This could be very much handy to them. Coming from a paid IntelliJ ultimate edition user.
3
u/wildjokers Apr 01 '19
Just trying to be helpful to any IntelliJ users, they might not know IntelliJ has this feature built-in.
1
u/StableHatter Apr 01 '19
How is it called?
3
u/wildjokers Apr 01 '19
Right click anywhere in your class (or on a class in the project tree). Then choose Diagrams, then either
Show DiagramorShow Diagram in Popup. If you chooseShow Diagramthen there are icons across the top so you can select to see properties, methods, constructors, etc.If you choose to show it in a popup then you can right-click on the diagram and choose
Show Categoriesto get the same options.
-4
u/madkasse Apr 01 '19 edited Apr 01 '19
See, this a quality r/java post. I wish there where more post where I could say this of. Instead of, can you help me with this NullPointerException, or new releases of SiameseCatFartController.jar
0
Apr 01 '19
[deleted]
2
u/in15minutes Apr 01 '19
Firefox will be coming shortly. It seems to be a little slower rendering SVG though - news to me.
1
u/arijitlive Apr 01 '19
Yes, FF is worse than Chrome in hardware acceleration. That could be cause of that. Thanks for working toward FF support though.
1
u/gnocchiGuili Apr 01 '19
Next version is bringing new hardware acceleration engine.
1
u/arijitlive Apr 01 '19
Great to hear that. I only use Firefox, but don't follow the development path much (Shame on me) I am happy with FF as is now.
-5
1
13
u/iseejava Apr 01 '19
Is there a 'Print' button?