Hey guys! How’s it going?
Separating domain logic of the http body handling from technical aspects is easy in JAX-RS thanks to Entity Providers.
In today’s episode of “JAX-RS Done Right!” we introduce Separation of Concerns to only have pure domain code in our application when it comes to handling http bodies, while every technical aspect is in separated code. The key for this are Entity Providers (i. e. Renderers and Parsers for a combination of Java Class and Media Type). There even are Default Entity Providers built into JAX-RS, so it is easy to get started with that.
In a future episode, we will extend the concept by intoducing our own Custom Entity Providers.
Code example can be found on Gitlab: https://gitlab.com/mkarg/jaxrs-done-right
Stay safe and… Party on!