开发者

Client or server side invocation to google API?

开发者 https://www.devze.com 2022-12-29 12:55 出处:网络
I\'m writing a web application with GWT and I\'v开发者_开发百科e to call google calendar\'s API to retrieve some information. I now have this dilemma: Is it better to use a client side invocation (usi

I'm writing a web application with GWT and I'v开发者_开发百科e 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?


I would call it from the server-side. Why ?

  1. 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.
  2. you can make use of strategies such as caching on the server side.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消