I need to decide between jQuery and GWT for my new project.
- developing in Java takes more time than the same thing using jQuery (at least for this project)
- the documentation is poor (for example, how should I know which elements should I use when designing the page? — there’s not enough documentation for this)
I’ve been using jQuery for most of my projects and it’s pretty good.
I want to convince the client that jQuery is better suited for this project and I need more arguments to support this.
I would go with JQuery.
I once maintained a GWT project that eventually forced me to re-write it twice. First as a refactored GWT app, second in JQuery.
Problems I found with GWT:
It forces you to follow its client/server structure. In the end all I want is AJAX and those good widgets. GWT’s widgets by itself don’t seem that good-looking. Aesthetically, I prefer Adobe Flex! But to keep the comparison closer, JQuery’s UI looks better than GWT’s. In addition you have that wonderful Theme Roller support from JQuery.
I’ve tried DWR. It’s great. It’s far easier to enable AJAX in your Java code using DWR than GWT.
If your group is most familiar with Java and you’re planning on doing significant amounts of client-side functionality then you should at least evaluate GWT. The type safety, Eclipse debugging and shared code between the server-side/client-side will feel comfortable to your Java development team.
First of all comparing GWT with jQuery doesn’t make much sense. While jQuery was build to make cross browser working with the DOM much easier, GWT is build to create large web applications.
So if you a bunch of static sides with some independent widgets, like calendar, slider and so on, jQuery is enough. If you want to build single page app, maybe with a large team, GWT is the better way. GWT has a lot well design architecture under the hood, especially the build in MVP pattern, UI-Binder templating system, i18n support etc.
Btw, as good the GWT architecture is build, you will have a lot of JAVA overhead. So if you project is growing, the time to compile your css and i18n properties will come annoying.
“Horses for Courses”
Pick whichever one makes the most sense for the project. Some things to consider
- Tight timescales and more familiar with one over the other
- Speed and maintainability for other developers to use the chosen tool. Prevalence of one over the other may have implications here too
- Have any code that could be used already in the project e.g. plugins, utility functions, etc.
Without knowing specifics about what the project is about, what your experience is and how open the client is to using different technologies/frameworks, there will be no decisive answer here.
Make that list of compelling arguments for one over the other, as I have started here and then discuss with others involved on the project to come to a conclusion.
The answer is not easy. The answer is “it depends”:
- if you know and like Java
- if your server code is also written in Java, writing client code in Java makes it possible to use the same code on client and server
- if you like things provided by strongly-typed languages: compile-time type checking, automated refactoring, automated code generation (Ctrl+1 in Eclipse), code completion (Ctrl+Space)
- if you like component-oriented programming (eg MenuBar creates a menu)
- if complexity of GWT (compared to jQuery) is not problem for you
- if big generated code is not a problem for you
- you don’t need to use the same code on client and server (eg. client – JS, server – Java or PHP)
- if you don’t need compile-time type checking, automated refactoring, etc
- if you don’t need component-oriented programming (to create a complex component in jQuery you need to create a series of divs, and call $(“those divs”).makeXXXXControl())
- if you like simplicity (jQuery is simpler than GWT)
- if you need very small code (eg to make website loading faster)
Personally I would recommend GWT for most projects, but jQuery also has pros and some people may prefer jQuery.
Does anyone know of a large scale project done in jquery?
Now, if you used gwt, you will also get the benefit of maintanability and code reuse this provides, BUT the gwt compiler will optimize away the polymorphism into concrete class usage, hence increasing performance.
There is an additional process that separates you from your final product. You develop your app in Java and you debug the Java code, yet you release a machine translated version of this code. For a decently sized app I can’t imagine that you won’t need to debug the actual code running on the browser at times, and this is going to be a headache, since it isn’t your code.
Since you write your code in Java you are limited to use Java libraries. If you find some JS library that you like it would be awfully difficult to add it to your GWT project, you may need to write a Java wrapper for it. If you are developing native JS you can just add it to your project.
If you may ever consider releasing your app on mobile platforms, then a native JS app can easily be wrapped inside phonegap and have access to several mobile platforms, without additional effort. There is a GWT wrapper for phonegap as well, but going back to my first item, if you have the choice to work with the real thing then why choose a solution that requires translation/emulation?
jQuery = low-level understanding
GWT = abstraction understanding = functional guarantee
GWT offers the advantage of compiler generated code so it may offer more of guarantee that your website will function normally. However like any large scale API you need to take the time to understand what this class does and what that class does and whether or not it is compatible with this API or nor.
low-level understanding may be more useful
GWT reassures managers but costly
But then again java and asp.net tend be preferred by larger companies b/c there is greater technical support (i.e. Oracle and Microsoft) and uptight on-the-edge managers tend to get better sleep at night when they know they can solve problem A by simply paying x amount of dollars for support. So after adopting the system they soon start realizing that technical support costs too much and it’s cheaper to pay more for better developers. Hence a java or .net career will usually put food on the table.
Low-level coding gives you almost a 100% understanding of what is happening, however with API’s you spend time playing bug detective on google and posting questions on sites like StackOverflow. But managers don’t understand this b/c most aren’t programmers.
my personal opinion would be for jQuery but thats because I never use Java and really like using the jQuery plugins.
Active user group and recent gaining popularity clearly indicates jQuery is the winner.