lundi 25 janvier 2010

"Wicket with GWT" and not "GWT vs Wicket"


Often, we compare Wicket vs GWT because they are both component-oriented. But the comparison stop there, because their approaches are opposed. Wicket is oriented server : the server generates web page. While GWT is client-oriented : the client is downloaded and communicates with the server.
Wicket ajax components are based on javascript libraries. This does not facilitate the development and maintenance of these components (using multiple libraries, the problem of multi-browser compatibility, web page size, ...).
GWT applications are oriented RIA, which is quite different from a "classic" web application and the user may be a little disoriented ("back / next" navigation, refresh browser, single mode page ...).
So why not combine the power of GWT with that of Wicket to create original web applications ?

Here is an article which proposes an architecture for combining the best of both worlds. Unfortunately, since 2008 it does not appear to have been implemented. In fact we can solved this equation with only GWT.
The single page mode that can disrupt the user. For this it is possible to create HTML pages which embed the javascript application generated by GWT. Each page is composed of area identified by ids, which are injected components of the GWT application (using RootPanel.get(id).add(myComponent)).
Navigating between pages is provided by :


public static native void setWindowHref(String url)/*-{ $wnd.location.href = url; }-*/;



In this configuration, the client becomes stateless (like a "classic" web application). But the components are more dynamic (as an application RIA). This approach may be useful in some cases to meet the requirements of users and do not change their habits.


Aucun commentaire:

Enregistrer un commentaire