3 ms·
I prefer to return different interfaces from each (or almost each) method. This way also a predefined order of calls is imposed which you may want sometimes. A
by chopin 9y ago
I prefer to return different interfaces from each (or almost each) method. This way also a predefined order of calls is imposed which you may want sometimes. A predefined order also makes similar uses look similar which I deem a benefit as well.
- jdmichal 9y agoI was wondering why this suggestion wasn't included in the OP, as it's exactly the route that the JAX-RS client specs took. There are several interfaces, and some of the fluent calls are basically terminal by leading to one of the other interfaces. It starts here with the `Client` interface: https://docs.oracle.com/javaee/7/api/javax/ws/rs/client/Client.html https://docs.oracle.com/javaee/7/api/javax/ws/rs/client/Clie... Which then leads to `WebTarget`, then `Invocation.Builder`, then `Invocation`. `Invocation` objects can then be executed to generate `Response` objects, or typed responses, depending on the overload used.