News for hackers. Stuff that matters.
Re:What's new in Servlet 3.1? - Java EE 7 moving forward by espinchi on Wednesday December 19, 2012 @11:38AM (#4943345)
I tend to think everyone is writing web Python or Ruby servers backed with some NoSQL database, that expose a RESTful interface to a fancy HTML5 client that leverages some cool JS framework.

At my workplace, we have this debate going on about what to do with our GUIs (that are used only internally). The alternatives are 1) keep them in Java Swing, 2) progressively rewrite components in Java FX 2, 3) go web. These are operational GUIs that talk RMI with our Java servers (which we won't rewrite).

What's your take on this decision? Do you think it is shortsighted to stay in the Java world for the GUI side, or am I being overly optimistic when I say we should just start over in web technologies?

Re:What's new in Servlet 3.1? - Java EE 7 moving forward by RyanZAG on Wednesday December 19, 2012 @12:59PM (#4943783)
I'd recommend taking a look at GWT - it is pretty much for your exact situation and works very well for that. You will still need to convert from Swing to HTML elements, but if you have done any sort of separation between UI logic and Swing itself, this is usually not too bad.

This way you can swap over your existing java apps to one of those fancy HTML5 clients you're talking about. ;)

Re:What's new in Servlet 3.1? - Java EE 7 moving forward by sgt on Wednesday December 19, 2012 @01:56PM (#4944064)
I would advise against GWT, after two separate projects - it starts off simple, but then as the project grows the more you regret basing everything around GWT in the first place. This guy will definitely not save time doing it the way you suggested.
Re:What's new in Servlet 3.1? - Java EE 7 moving forward by RyanZAG on Wednesday December 19, 2012 @02:14PM (#4944179)
You make that statement as if there is no way you could be wrong - yet there are multiple very large GWT deployments running very happily in production. I've done the exact thing - moving a finance system to a GWT frontend (it also retained a desktop frontend), and the system was reasonably easy to convert. You hook up some html in UiBinder, get some RPC working for the data, login form, refactor the widgets to use the uibinder html, use activities/places to handle navigation and backstack, and off you go.

So "definitely not save time" seems a bit harsh? Maybe worded "if you have anything like my experience, you will definitely not save time"?

EDIT: What part of GWT caused you issues btw? Maybe my uses never hit on the trouble parts.

Re:What's new in Servlet 3.1? - Java EE 7 moving forward by sgt on Thursday December 20, 2012 @01:03AM (#4946486)
One complaint was that once the project started growing past a certain size, the compile times (into javascript) took significantly longer.

The rapid development cycle that we had in the beginning of the project seemed to disappear. Occasionally some strange GWT bugs started popping up, but figuring out what was wrong was very difficult GWT is by nature Java compiled into JavaScript, and tools like Firebug would give a non descript JS error message. This was several years ago though, around GWT 1.5 or so.

I don't have any GWT 2 experience and I should have emphasized this, however I witnessed another project (a year ago) based around GWT 2 and although with capable programmers, they found GWT to be a burden rather than a benefit, and frankly the result looked horrible.

Re:What's new in Servlet 3.1? - Java EE 7 moving forward by edwinnathaniel on Wednesday December 19, 2012 @02:49PM (#4944390)
To GWT or not to GWT is a tough call.

There are features of GWT that I love the most when developing front-end code: resource bundle (auto-gen CSS sprites both the images and in Java code, no more hacky solution), i18n, UiBinder, JUnit (provided you 'architect' the code using MVP), great JS compiler (pruning dead code, producing multiple outputs for browser specific).

GWT infrastructure is definitely years ahead of anything out there in the market.

Having said that there are a few things that I missed from using normal tools like HTML/CSS/JS: fast refresh/update, debugging inside firebug vs attaching your IDE to debug front-end stuff. In general, development in GWT is slower if you don't have fast machines :)

Re:What's new in Servlet 3.1? - Java EE 7 moving forward by RyanZAG on Wednesday December 19, 2012 @03:22PM (#4944591)
> fast refresh/update, debugging inside firebug vs attaching your IDE to debug front-end stuff.

Have you tried out the new SuperDevMode? It lets you use sourcemaps to debug the java code directly in the browser. Only works with Chrome currently, I think. I tried it out a bit but it felt a bit clunky, and I actually prefer debugging in Eclipse to firebug/chrome, I think. Couple seconds of startup time don't worry me as much as others, I guess. I use the time to think through what should happen and where problems could show up.

At any rate I agree with you on how good the tooling support for localization/css/etc is - I think the learning curve is too steep for most people? The size of the getting started guide is pretty crazy, and there is a lot of confusing deprecated stuff, especially in the panels (some for html quirks mode (IE6), some for standards mode...)

Re:What's new in Servlet 3.1? - Java EE 7 moving forward by edwinnathaniel on Wednesday December 19, 2012 @04:53PM (#4945061)
The last version of GWT that I used was 2.1 and I believe SuperDevMode was there already (open in any browser, hookup with this SWT/Swing UI that relays back to your Eclipse IDE). Back then it was very very clunky and slow to the point that if you have large rich UI it may even crash.

Learning curve of the GWT API itself was okay, but the setup ceremony is not (preparing IDE, build, mavenizing, the whole end-to-end from start to finish). I don't know if this can be improved since this may be inherent culture from the Java world.

But like anything in this world: you get some, you lose some (e.g.: no silver bullet). At this time, it's a matter of preferences and specific to each individual situation.

If you have a well-defined project, GWT may suit you well. But if you need something that change quickly and frequently, preparing GWT may be yet-another-too-technical stumbling block.

Re:What's new in Servlet 3.1? - Java EE 7 moving forward by RyanZAG on Thursday December 20, 2012 @02:26AM (#4946666)
Ah.. nope, SuperDevMode is a very recent invention from GWT 2.5 - it uses Chrome's new source map tech to allow Chrome to overlay and debug your java code inside Chrome itself. Firefox will soon have the functionality too which will let Firebug work directly on Java code.

https://developers.google.com/web-toolkit/articles/superdevm...

I agree very much with your last statement though - hacking something together with no concern for future changes/requirements in Java nearly always ends in catastrophe.

Re:What's new in Servlet 3.1? - Java EE 7 moving forward by lmm on Wednesday December 19, 2012 @11:58AM (#4943444)
If it ain't broke don't fix it. Why do you want to replace them? Is the development burden of maintaining them in Swing really that high? Would it make life easier to have the UI be available on the web? If either of these is a "yes" then make the case on those grounds; "everyone is writing..." is a terrible reason for doing something.

In any case I see no point rewriting them in Java FX, that would just be replacing one dying technology with another.

Re:What's new in Servlet 3.1? - Java EE 7 moving forward by traxtech on Wednesday December 19, 2012 @12:00PM (#4943448)
The question should be "why do you want to go away from java swing ?" What are the problems/limitations you encounter ? If there's no serious reasons to change, why change ? (well, there's the fun to rewrite all, the fun to learn technologies, but from a business standpoint, that's not reasonable)
Re:What's new in Servlet 3.1? - Java EE 7 moving forward by espinchi on Wednesday December 19, 2012 @02:13PM (#4944175)
One argument for going web is recruitment: the pool of active developers that know Java, Swing and Spring is shrinking.

Also, the size of the developer community in the Java/Swing world versus that in web technologies is not even comparable when it comes to sharing knowledge and open-source components. (I work for a lab, so many open-source licenses are compatible for us.)

And, sure... it would be so much fun!

Re:What's new in Servlet 3.1? - Java EE 7 moving forward by kodablah on Wednesday December 19, 2012 @11:57AM (#4943431)
I think you have to weigh the importance of the internal application and it's need for a rewrite. It just may not be worth it. If you do, I would recommend web, but you'd still have a significant JVM-based-language backend I'd assume since you have to use RMI as your communication protocol. I personally would not do JavaFX because you aren't really stepping up enough to make the rewrite worth it.
Re:What's new in Servlet 3.1? - Java EE 7 moving forward by shaydoc on Wednesday December 19, 2012 @04:40PM (#4945008)
I have gone completely decoupled web html/css/ javascript client architecture talking to restful services, with support for web sockets thrown in too.

Enable your server side for rest and go web.