The buzz is starting again about richer web interfaces (think GMail, Google Suggest),
slashdot amplifying it.
I've got my lot of thoughts to share about this because I'm currently incubating the
Second System Syndrom as my current task is coming to an end. I've been busy designing and building a JSP taglib and some strutseries using JavaScript, JSON and XMLHttpRequest.
Shared ModelThe model has to be shared between the client and the server. Or, to be more precise, the model has to be replicated: currently, I'm sending far more data through background HTTP requests that what I need (and because of the new UI opportunities offered by the taglib the forms tend to be more complex and hence contain more data).
I'm currently envisioning two ways of doing it:
- directly mapping the Java Beans to replication enabled JS Objects.
- using server-side Javascript (Mozilla Rhino) with native objects and proxy objects on the client-side.
I'm afraid of the second solution being overkill (and I've not even thought how to make it fit with Struts) but I've got the intuition that useful things can be achieved with such a design but I can't say which. Anybody?
Toward more RESTful web applicationsIt may seem counter-intuitive but, given (ideally taglib-enforced) guidelines, enhanced web UIs make the web more RESTful. My main arguments are :
better HTTP support (PUT, DELETE methods)
less cluttered URL-space: far less technical URLs (some things can be entirely done client-side and the others can all be crammed into a couple of endpoints -- not that I support such extremities), so far more URLs really represent business processes and business objects.
Concerning REST, the major impediment (in my ecosystem) is Struts (mantra: must, not, abandon, Struts). Concerning business objects, I certainly could benefit from embedding the hibernate IDs into my URLs but I didn't really thought about it yet.