{8.0.0-new} Dual-purpose (end-to-end) interfaces
A common coding practice is to use the same Java interface to define both your server and client side REST interfaces. The advantage to this approach is that changes that you make to your REST interface can be reflected in both places at the same time, reducing the chances for compatibility mistakes.
What makes this possible is that method-level annotations such as
The general approach is to define your {@link oaj.http.remote.Remote @Remote}-annotated interface first. The following example is pulled from the PetStore app:
Next you define the implementation of your interface as a normal Juneau REST resource:
Then use the interface as a remote resource like so:
In the example above, we chose to add the
Note how we didn't need to use the