4 ms·
You're counting required language keywords towards what makes a micro-framework? That's bullshit. You're never going to get away from some of the keywords in Ja
by meddlepal 13y ago
You're counting required language keywords towards what makes a micro-framework? That's bullshit. You're never going to get away from some of the keywords in Java, nor does that make JAX-RS less 'micro'
Here is an example in Groovy using JAX-RS:
@Path("/hello")
class HelloWorld {
@GET
def sayHello() {
"Hello, world!"
}
}
Almost as clean. The braces and parens make it a bit uglier; but those are just part of the language.
- towelrod 13y agoThe point is that you shouldn't have to configure things like @Path because they can be inferred from the class name. Why not: class Hello { def get() { "Hello, world!" } } I would prefer to see this and then let someone have a routing config somewhere else if they want to move the /hello endpoint.
- Xorlev 13y agoIt doesn't work how you want it, fine, don't use it. It's super brief for the rest of us.
- meddlepal 13y agoSounds like a preferential thing then; I prefer to keep everything together. I've never liked the separate routing config approach. Play Framework uses(d?) it in the 1.x branch and I always found it annoying. Similarly old-world Servlets were done that way too. You'd put the routing information in an XML file and the container would read it at start up.
- vorg 13y agoNot only uglier, but a lot sloooooooower.