users@jax-rs-spec.java.net

[jax-rs-spec users] Re: Proxy-based client API

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Tue, 18 Nov 2014 14:39:48 -0500

Willem,

 The topic of a proxy-based client API or higher-level API was discussed during JSR 339 (JAX-RS 2.0). Although it does simplify development for some clients, a lot of experts believe this is not right model to access RESTful services due to the additional coupling (apparent or real) introduced between clients and servers.

 The "next generation" of RESTful services is likely going to be much more hypermedia driven, for which proxy-based APIs aren't a great fit. I encourage you to look at the work done in Hydra [1] --there's already a W3C recommendation under way.

-- Santiago

[1] http://www.hydra-cg.com/
  

On Nov 16, 2014, at 3:53 AM, willem.salembier_at_gmail.com wrote:

> What is the status of standardizing a proxy-based client API in JAX-RS?
> The current client API is rather low-level.
>
> The main goal is to reuse the same JAX-RS annotations on an interface
> client-side. The implementation creates a stub which a client can use
> to call a restful resource. This model brings the same simplicity we
> have on the serverside to the client.
>
> All JAX-RS implementations have some kind of proxy-based extension
> nowadays and it is also the core idea of frameworks like Square's
> Retrofit and Netflix Feign.
>
> Some references:
> http://docs.jboss.org/resteasy/docs/1.0.1.GA/userguide/html/RESTEasy_Cl
> ient_Framework.html
>
> http://cxf.apache.org/docs/jax-rs-client-api.html#JAX-RSClientAPI-Proxy
> -basedAPI
>
>
> https://jersey.java.net/apidocs/2.9/jersey/org/glassfish/jersey/client/
> proxy/package-summary.html
>
> http://square.github.io/retrofit/
>
> https://github.com/Netflix/feign
>
> Best regards,
> Willem Salembier