views:

104

answers:

4

I would like to know, how powerful/viable are JavaScript only clients based on say, GWT/gxt/vaadin, when compared to DHTML clients such as those made with wicket, tapestry, click etc?

My boss has insisted on using GXT (due to its nice colors and theme) on a project that will most likely become very big with lots of screens. I am against the idea of a javascript only client, especially when the javascript is generated from Java code. I have tried to advice him that we use something like wicket whereby we construct the screens with html but put in ajax where and when neccessary.

How viable is such a JavaScript client? I understand that JavaScript was intended for minor web page enhancements, and not all browsers, especially mobile devices have complete support for JavaScript.

+1  A: 

Yes, it is viable for certain applications. Consider Gmail, Google Docs and Google Maps as typical applications where this works, and is probably the most feasible approach.

Some rich UI JavaScript frameworks, such as Ext JS also rely on this technique.

Daniel Vassallo
Actually, Gmail, Google Docs and Google Maps **don't** use pure-javascript for rendering. Quite the opposite the examples you gave are very good implementations of progressive enhancement and is the very opposite of what the OP's boss is asking him to do. So your answer is really a counter-argument for the technique. note: turn off javascript and try to access those Google services.. they should still work!
slebetman
@slebetman: They do progressive enhancement by providing two/three totally different applications: the full JavaScript app, one for browsers with JavaScript disabled, and one for mobile browsers. I don't think it's a counter argument for the feasibility of the first solution.
Daniel Vassallo
@slebetman: Here's what I mean: http://img8.imageshack.us/img8/7688/gmailnojs.jpg... One of the core principles of progressive enhancement is that "basic functionality should be accessible to all browsers"... However, the core functionality in some applications cannot be made available without JavaScript (Google Docs for example, and even Maps to some extent).
Daniel Vassallo
+1  A: 

I've built javascript only web apps for ages.
First in SAP projects for big multinationals. And now on a new project:
https://beebole-apps.com?demo

So yes it is powerful and viable.

Mic
But bad practice. I only ever do this if forced by my boss (and I have done this).
slebetman
Starting is frustrating and messy, there is no safety nets, like in many server frameworks. But then, after a while, if you set some processes and rules, this is a very gratifying way of work for the developer... and for the boss.
Mic
@Mic, your application looks great. I did a 'view page source' and there is no markup, just a link to a javascript file. I did the same with gmail and i see alot of markup. I think GMail is a dhtml application but with markup and alot of javascript but not purely a javascript application. By pure javascript i mean everything including the layout is dont with javascript.
joshua
@joshua: In Gmail there's a lot of inline `<scripts>`. I can only see about 20 lines of HTML, and it's mostly divs with messages like `'This is taking longer than usual.'` and related messages. There are also a couple of iframes. However, what you see in Gmail, both the interface and the functionality, is rendered from JavaScript.
Daniel Vassallo
@joshua, the page is compressed by a script. Everything is inside: HTML, CSS, images and JS. A single http call loads all the app. In my tests it was the fastest way. And all the HTML is rendered client side, using our javascript template engine PURE.
Mic
A: 

Javascript-only webapp can be extremely powerful, and it's viable for certain applications, say, an Instant-Messenger webapp?

You mentioned that there are lots of screens in your web-app. One of the advantages from GWT/GXT is the fact that you can unit test your UI-layer with JUnit. This is an extra testing you can do on top of, say, Selenium. This is essential if you'd like to make UI testing a part of the continuous integration process, and, as the team grows, you'll definitely want to have tests around to make sure everything works (At least in theory.)

However, if what your boss meant to do is to build an in-house, custom Javascript engine using GWT's JavaScript Native Interface (Link), then I'm not sure...

Another advantage with GWT-like-engine over Wicket is that you can rely on HTML-code-gen to generate standard-compliant (In theory) HTML code. With framework like Wicket, it is hard to ensure every single developer on the team to author good HTML code - Especially when the team gets bigger.

DashK
A: 

Disclaimer: I'm a member of the Vaadin team.

Our Timeline demo is a good example of what can be achieved with Vaadin and GWT in client side, but I think all of the options presented in this discussions are viable given enough time.

Since you are going to start a big project you should build a simple proof-of-concept app with each of the relevant frameworks. If your PoC includes at least some of the more complex use cases you'll probably can make a pretty informed choice based on the experiences you get while building them.

I urge you to at least evaluate Vaadin. With it you write only server-side Java code and Vaadin will create a slick and professional browser UI for you. Client side can be easily extended using standard GWT (also pure Java), and there are no HTML templates, tag libraries or XML configuration involved at all. A Vaadin UI is fully Ajax'ed and lazy loading out of the box, and it easily integrates with any server side technologies, eg. Spring.

In addition to the development model advantages you get top-notch documentation, a bi-weekly update schedule, a very lively community filled with helpful experts, 100+ useful open source add-ons, and a 10 year old backing company with help on hand should you need it.

hezamu
I checked it and i still think its a bad idea to cell a component that should be core such as the JPA Container. I like the look and feel of it.
joshua
It was a tough choice, but not all (even most?) Vaadin apps use JPA, so we decided to make it an add-on so it won't bloat the JAR for those who don't need it. Also, if you don't want to use the dual-licensed JPAContainer written and supported by Vaadin Ltd, there are several Apache licensed options provided by the community, eg. LazyQueryContainer, EclipseLinkContainer and GAEContainer. All of these and more are available in the Vaadin Directory.
hezamu