restful

From Documentation

External RESTful Service

If your RESTful service locates at another server, then calling RESTful service in a ViewModel / composer is the recommended way. Even the RESTful service is implemented within the same application with ZK, then we still recommend this way because it's the most straight-forward way, less complicated and easy to maintain.

Another possible alternative is to communicate with RESTful service and ViewModel with client-side binding. But this way requires writing some javascript codes to get data from RESTful service and send those data to a View Model. Its concept is: Restful-integration.png

Client-side binding provides a simlified way to communicate with ViewModel with Javascript API, please refer to http://books.zkoss.org/zk-mvvm-book/8.0/data_binding/client_binding_api.html. You can also see the client side binding demo (the last one) of zk 8 key feature http://www.zkoss.org/zk8keyfeaturedemo/

I think the request (or calling) to RESTful service is always required because you want to reuse it. It still requires another request to ZK ViewModel (controller) to handle the event. Either the 2 requests are called nested(1st) or chained (2nd), they are necesary in such scenario. If you treat the RESTful service as a business service layer, then the calling from a contrller (viewmodel) to a service layer is quite common in a multi-tier web application.