agrestio / agrest

Server-side Java REST Framework for easy access to data graphs from various backends
https://agrest.io
Apache License 2.0
81 stars 34 forks source link

Reduce / remove dependency of LinkRest core on JAX-RS #224

Open IRus opened 7 years ago

IRus commented 7 years ago

As I see, currently LinkRest coupled with jax-rs (javax.ws.rs.core.Configuration). Would be great to provide common implementation, which can be used with spring-webmvc or bootique-undertow for example.

I think we should provide our interface, which I can implement to support other servers.

atomashpolskiy commented 7 years ago

We're pretty deeply integrated with JAX-RS. From the top of my head we're using (in the order of increasing API/code dependency):

We also heavily depend on Jersey and JAX-RS annotations in tests.

atomashpolskiy commented 7 years ago

I'd say the most rational way to use LinkRest with anything other than JAX-RS would be to create a bridge library (rather than attempting to "generify" the LinkRest itself), possibly with a limited number of features. This library will provide a decorating layer of LinkRest interfaces, that will be responsible for translating the particular REST/HTTP framework artifacts to JAX-RS artifacts. The library will also be required to provide alternatives for JAX-RS services that happen outside of the "resource" method body (i.e. request payload pre-processing and response/exception encoding).

andrus commented 7 years ago

Actually our dependency on JAX-RS is thinner than it appears. A number of planned improvements ( monadic processor specifically) would move us to an LR core that is agnostic of specific request/response interface. So while I don't expect this to happen overnight, JAX-RS independence may evolve as a side effect of the other changes.