4 ms·
I like Jersey (and the standard API it implements: JAX-RS) a lot on its own (as compared to using a larger framework like Spring). However it can be difficult t
by eatonphil 7y ago
I like Jersey (and the standard API it implements: JAX-RS) a lot on its own (as compared to using a larger framework like Spring). However it can be difficult to program imperatively.
You'd expect in a compiled language like Java you'd figure out most of your bugs during the type-checker pass. But there's so much implicit structure, class loading, and annotations that make Jersey apps mostly dynamically typed. You've got to compile and then hit every API endpoint/middleware to know it's registered at all.
Even when you find the explicit APIs they are cumbersome to use, requiring many lines of code for something that should be simple like imperatively registering a route.
I put together my own notes on using Jersey, JOOQ (an ORM), and PostgreSQL a month ago. My aim was to be as explicit as possible (though I did still have to fall back on class loading a few times). [0]
[0] http://notes.eatonphil.com/a-minimal-rest-api-in-java.html http://notes.eatonphil.com/a-minimal-rest-api-in-java.html
- Scarbutt 7y agoWas looking for a Java lightweight framework for an API and, there are so many! Javalin, Jooby, Spark, Micronaut and more, what do you like about Jersey over these ones?
- eatonphil 7y agoIt's a vanilla implementation of JAX-RS. The rest of the libraries are lightweight wrappers of JAX-RS with few committers or massive wrappers of JAX-RS with a lot of development overhead. JAX-RS on its own is mostly at the right level for me (with the exceptions mentioned).