I'm writing a web application with GWT and I've to call google calendar's API to retrieve some information. I now have this dilemma: Is it better to use a client side invocation (using javascript or gwt-gdata library) or using the standard google library for java to call the service at server side and then passing all the data to the client via an async call?? I'm not able to understand pros and cons of the two approaches... In particular, I need to call several time the calendar API to retrieve events and let users add new ones, etc. Can you help me?
+2
A:
I would call it from the server-side. Why ?
- it means your client-side view code is dedicated to providing a view only. You're not confusing matters by calling multiple services, and you're enforcing separation of concerns.
- you can make use of strategies such as caching on the server side.
Brian Agnew
2010-05-09 18:56:13
You're right, but is this worth the increase of complexity due to the passing of data to client with an object made exactly to do this thing?? Is there a way to handle the object passing easily??
Raffo
2010-05-10 10:37:23
+1
A:
Check the performance of using the server-side library. I found with the search library, that the round-trip time from client to server and back to the client was too slow.
So you're suggesting to use the client side invocation for performances reasons, I thought this was one of the key point..
Raffo
2010-05-10 19:50:37
I was working with the AJAX search library. My first implementation, had GWT send the request to the server, the server ran the search and then return the results to the client. There was a noticeable delay of a few seconds for this round trip. Using the client library, the results are almost instantaneous. Of course your mileage may vary...
2010-05-10 20:43:16