Live data from Hacker News

Java REST framework Dropwizard 1.0 released

dropwizard.io

21–30 of 88 posts

Re: Java REST framework Dropwizard 1.0 released

#21
post #5

Funny that everybody rush for REST framework, while most of the time people cramming REST in their applications need less "read, upload, replace, delete" operation model and more "normal functions, except called remotely" provided by RPC. But RPC-over-HTTP (XML-RPC, JSON-RPC, or even Thrift) is a problem solved long ago, so it's not sexy enough, I think.

REST is like set of best practices to design API end points like define resource as end point and map standard HTTP methods to certain operations. This makes it easy and leads to a standard in API designing. And underlying technology can be RPC or servlets too. For example define end point "/user" and client knows how to create update or delete user where as before Rest these used to be different end points for each of these operations or have to specify the kind of operation

Re: Java REST framework Dropwizard 1.0 released

#22
post #11

Dropwizard is really just an opinionated bundling of sane Java libraries that don't suck, and is essentially tailor-made for the (quasi-)event-driven processing model of: 1. request comes in 2. do stuff here 3. response goes out While this may not sound very exciting, this is exactly what goes on in HTTP APIs. People these days use Node or Go for this kind of stuff, but Dropwizard makes it very pleasant to do it in J…

My greatest gripe with Java was the amount of crap one had to go through just to build a simple Rest API. When I saw DropWizard I thought it solved that need. Maybe it's time to get back into Java development...

Re: Java REST framework Dropwizard 1.0 released

#23
post #7

Dropwizard is great for REST APIs (... as the title says). However if you want to use traditional views (MVC, html templates, security, forms etc) then please check something else (I tried it and lost many hours -- in the end I still couldn't do even basic things). For traditional web development, I recommend spring-boot which is almost as easy as dropwizard, it also doesn't need an application container and fully su…

I agree completely. For a long time I was avoiding Spring because bloat and XML, but then I finally gave in and tried Spring Boot. It is most excellent. Nearly all bloat is opt-in, it does everything, and absolutely zero XML configuration needed. I've tried Dropwizard before, and use it for two applications I have running. It works, but it's not great (because it's not just a rest API, but also has GUI and user management). I'll be porting it to Spring eventually.

Re: Java REST framework Dropwizard 1.0 released

#24
post #11

Dropwizard is really just an opinionated bundling of sane Java libraries that don't suck, and is essentially tailor-made for the (quasi-)event-driven processing model of: 1. request comes in 2. do stuff here 3. response goes out While this may not sound very exciting, this is exactly what goes on in HTTP APIs. People these days use Node or Go for this kind of stuff, but Dropwizard makes it very pleasant to do it in J…

Spring boot is the dropwizard competitor for people who don't mind Spring magic. Jhipster is a project that uses spring boot to make the project setup pretty much as easy as in rails. https://jhipster.github.io There IS still cool stuff happening in the Java world

Re: Java REST framework Dropwizard 1.0 released

#25
post #5

Funny that everybody rush for REST framework, while most of the time people cramming REST in their applications need less "read, upload, replace, delete" operation model and more "normal functions, except called remotely" provided by RPC. But RPC-over-HTTP (XML-RPC, JSON-RPC, or even Thrift) is a problem solved long ago, so it's not sexy enough, I think.

REST is like set of best practices to design API end points like define resource as end point and map standard HTTP methods to certain operations. This makes it easy and leads to a standard in API designing. And underlying technology can be RPC or servlets too. For example define end point "/user" and client knows how to create update or delete user where as before Rest these used to be different end points for each…

More like set of worst practices. You have some API exposed in plenty of endpoints instead of one, and on top of that you embed one of the call arguments in the URL itself.

And no, it doesn't make designing API easier if you preallocate "read", "create", and "delete" operations to separate HTTP methods, and then put all the other operations in POST. "Create" and "delete" in many cases don't even make any sense to guarantee their being specially distinguished.

And you say that RPC can be used under REST. Do you have any example of a REST client library that actually can do that? It's the first time I ever hear about this way. Almost everybody else uses REST like an underspecified RPC protocol, cramming call request into an ad-hoc JSON structure to HTTP POST and mixing error reporting from transport layer and from application.

Re: Java REST framework Dropwizard 1.0 released

#26
post #11

Dropwizard is really just an opinionated bundling of sane Java libraries that don't suck, and is essentially tailor-made for the (quasi-)event-driven processing model of: 1. request comes in 2. do stuff here 3. response goes out While this may not sound very exciting, this is exactly what goes on in HTTP APIs. People these days use Node or Go for this kind of stuff, but Dropwizard makes it very pleasant to do it in J…

My greatest gripe with Java was the amount of crap one had to go through just to build a simple Rest API. When I saw DropWizard I thought it solved that need. Maybe it's time to get back into Java development...

If you love dealing with magic "comefrom" annotations, codegen that isn't debuggable, and foundational libraries that have to resort to bytecode manip to get stuff done, then go ahead.

Re: Java REST framework Dropwizard 1.0 released

#27
post #16

Earlier quoted context omitted.

Dropwizard has templating engines integration and form validation.

I'm aware of that. However, have you tried using them in any non-trivial project? (for example, a project that supports authentication ?)

I successfully deployed several internal apps using DropWizard (0.9.x) with two different authentication schemes last year. Wasn't too difficult.

Re: Java REST framework Dropwizard 1.0 released

#28
post #3

Nice to see a 1.0 release. We've been using Dropwizard for various public and internal APIs for a couple of years and have been very happy with it. The components (jersey, jackson, coda hale metrics) are all very pleasant to work with, and generally have low-ceremony APIs that feel as productive as the ruby or python equivalents while providing the performance and operability of the JVM. It's not the fastest or most…

What JVM microframeworks would you recommend for streaming or async?

Re: Java REST framework Dropwizard 1.0 released

#29
post #9

Earlier quoted context omitted.

What templating language did you use with Spring MVC?

I've been using Thymeleaf with Spring for a while and almost always exclusively use it with Spring Boot because it's pretty much right out of the box ready to go. I stumbled on it a long time ago because I had the problem of Java devs needing to integrate templates built by front end devs and all the churn that goes along with it. It uses custom tag attributes like th:href to swap the computed value in on template re…

One issue is if you're using Angular. Your html document needs to be xhtml compatible, meaning that an expression like this:

  
Needs to become:

  
If this doesn't bother you (along with &gt; for <, etc) then go ahead.

Re: Java REST framework Dropwizard 1.0 released

#30
post #25

Earlier quoted context omitted.

REST is like set of best practices to design API end points like define resource as end point and map standard HTTP methods to certain operations. This makes it easy and leads to a standard in API designing. And underlying technology can be RPC or servlets too. For example define end point "/user" and client knows how to create update or delete user where as before Rest these used to be different end points for each…

More like set of worst practices. You have some API exposed in plenty of endpoints instead of one, and on top of that you embed one of the call arguments in the URL itself. And no, it doesn't make designing API easier if you preallocate "read", "create", and "delete" operations to separate HTTP methods, and then put all the other operations in POST. "Create" and "delete" in many cases don't even make any sense to gua…

You're wasting your breath. REST zealots will never be convinced that anything other than the magic four of GET / PUT / POST / DELETE is necessary.

It's like someone advocating writing all software should be written in Brainfuck, because the cognitive load of remembering eight operators is so much easier than learning all these keywords and syntax and runtime libraries that come in other languages. Except whereas our imagined Brainfuck advocate would be rightly ignored, REST has somehow become the fucking dominating paradigm of our industry.

The idea that reduced complexity in one area might trade off with much greater complexity in another simply does not wash with these people. They have a resource & verb shaped hammer, and they are going to use it to batter each and every API into some kind of nail shape, no matter the effort it takes and the carnage that ensues.

Post reply on HN