Research Log of Web Science Students

Computer Science is not simply programming

Sparring with implementing RPC and our first web service

with one comment

I feel like an engineer in National Geographic’s Megastructures. I’ve just finished doing the save project element of our “Learn a module” feature and I am very eager to develop the other building blocks.

For this feature I wanted to achieve a web 2.0 effect and not like a dull banking web app that is our create a module feature. I wanted form changes be done client side as well as the save project element happen without doing a page load. That only means one thing, javascript.

Somehow I felt during the sembreak that this was coming and it was a good thing I looked into GWT. So the solution I have been thinking of was to have client side code work with Spring MVC. Not very easy and more importantly not very obvious especially if you know that Spring Form Controllers make use of the Spring Form taglibs which all but decouples you from the Spring controller (well if you knew Spring-JS, this wouldn’t be a problem)

But it was a good thing someone told me that at the end of the day, Spring taglibs are just abstractions for raw HTML. This is something I will never forget for as long as I am working with Spring. So we wanted javascript. Paolo knew hot to hack javascript but what about AJAX? That’s something he told me he didn’t know. Fortunately in GWT there was a better way. And with RPC, it took care of the AJAX part too.

Working on those assumptions, I set out to do something I feel no one has ever done before (according to Google and so far at SO).

There were of course a few hurdles along the way. One is GWT is tested in HTML and not in JSP and so I had to get that obstacle out of the way by copying and pasting from the GWT generated HTML into the JSP. I still do and will do for the next few GWT modules.Then I had to do some small tests (no not unit tests for the first time in my whole developer life since April 2009) to convince myself that it would work and that I wouldn’t have to fret to look for another solution (or worse manually write javascript and God forbid make an RPC call using that too). With that out of the way, I had to review my GWT blog posts during the break and that took a while to remember. I ran into problems with nested divs — something I haven’t solved and will bring up with Paolo because he has a lot of nested divs. There were of course errors setting the controller up and omissions in the gwt xml configuration. And to top it all off, viewing jsps in the hosted mode browser was painfully slow. And if that wasn’t enough one of my domain objects was being meddled with by the DataNucleus Enhancer! I am like what the hell did it care? It’s not like it was a @PersistenceCapable.

But I am glad. They’re all behind me now and up to Paolo to show me the forms I told him to do. I hope he finishes it soon. Can’t wait to build my next megastructure.


Written by Jose Asuncion

November 24, 2009 at 6:55 pm

Posted in Hardwire

One Response

Subscribe to comments with RSS.

  1. […] we’ve already exposed our GWT RPCs as a spring bean and if GWT RPC has a solution for that, I just feel that with a mature technology such as Spring […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: