I’m developing a server-client application. It is a service that is supposed to be used by thousands of users so it should scale well. The server side is done in Spring + JPA(Hibernate) and it provides about 80 API methods. There will be multiple clients – GWT webapp, mobile devices clients (iOS, Android, Windows) + a simple desktop client (Eclipse RCP / To be decided).
I’m considering various ways to connect to the server side. My ideas are (maybe there are some other, better ways):
- Use SOAP Webservices to expose server API to all the clients
- SOAP WS are considered to be slow and I don’t know it can handle all the communication
- Android doesn’t officially support SOAP WS (bu there are some 3rd party libs)
- Use RESTfull WS to handle communication
- better performance than SOAP
- official support on all the mobile devices
- may be difficult to access RESTfull WS from non-web, desktop client
- Use REST WS for mobile, GWT Request Factory for webapp
- Request Factory is recommended way to communicate with GWT client (at least it was on 2009 Google I/O). I suppose it should perform better than Web Services?
Which solution (listed above or not) would perform best and be the most productive for developers?
If you’ve worked on a similar project, I’d love to know your opinion 🙂
I’d vote for Using RESTful services on the backend, and interacting with that from the front end of your choice.
This gives you the most flexibility in terms of serving multiple clients. For instance, you can end-of-life a front end technology without having to remove any server side code, or you can introduce a new front end without any back end changes.
If you avoid trying to support both REST WS for mobile and GWT-backed server side classes (such as GWT-RPC) for webapp, you will have the following advantages:
Don’t worry about one technology or another not being able to consume your services: REST WS is becoming so popular that there are a variety of ways to use those services from any front end. For instance, a GWT app could use GWT overlays to map JSON responses to GWT/Java objects, and a desktop client could use Apache HTTP Client.