jQuery Mobile in Java

View project on GitHub
Whizu Download
jQuery Mobile widgets
Pages Accordions Buttons Collapsibles

About me

Please contact me on Google+.

Rudy D'hauwe

Why Whizu

Even when using the latest and greatest frameworks and disciplines, writing fast, highly interactive web applications involves a lot of complexity. It is time consuming and web applications are often considered too slow, that is, by end users. I wondered whether we could build a programming system for developing ridiculously fast HTML5 applications (as in happy end users) in which we would just need to write the essential stuff (as in easy to learn, easy to maintain, flexible to change).

What's the problem

When writing a complex, highly-responsive web application, there are all kinds of really difficult programming tasks that you end up doing over and over again for every feature you want to write. These are pains all too familiar to authors of Web 2.0-style software.

Let's have a look at a classical architecture.

First you need server code to figure out what data the browser needs. Hopefully you have an ORM layer (Object-Relational Mapping), but you still need to carefully structure your code to minimize your backend dispatches, and you need to carefully keep that in sync with your front-end code lest you don't fetch enough data or hurt performance by fetching too much.

If it's a Web 2.0-style app, you re-implement a ton of that server-side code in JavaScript, once for creating the page and then again as controller code for keeping it up to date and consistent. And when the user changes something, you bottle that up - typically in a custom over-the-wire format - and send it as an XHR to the server. The server has to de-serialize it into different data structures in a different language, notify the persistence store(s), figure out what other clients care about the change, and send them a notification, which is handled by yet more JavaScript controller code. Offline support? More code.

This is not a one-off task: it's rote work that adds error-prone complexity to every feature that you build in every application. By the time you're done with all this, the important and novel parts of your application are only around 10% of your code.

Lightweight. Fast. Easy.

Whizu is an all-Java approach to Web 2.0 application development, providing you with an easy-to-use Java API to write jQuery Mobile (jqm) applications that doesn't require any client-side JavaScript coding. It is a lightweight Java library with a minimal footprint, runs on any Java servlet engine and focuses on developer productivity and runtime performance.

No XHR, no ajax, no serializing, no deserializing of data, no parsing… at least not by you. Whizu runs your Java code and streams it automatically into HTML, CSS and client-side JavaScript, taking care of all former complexity including real-time bidirectional data synchronization. Whizu includes a port of jQuery to Java and has Java API support for jQuery Mobile and jQuery UI. Whizu is however flexible allowing you to easily provide a reusable, self-explaining and easy-to-use Java API yourself for any JavaScript library.

Written by Rudy D'hauwe | Copyright © 2013 | All rights reserved.