Live data from Hacker News

Ask HN: What stack would you use to build a CRUD web app on the JVM today?

news.ycombinator.com

161–170 of 213 posts

Re: Ask HN: What stack would you use to build a CRUD web app on the JVM today?

#161

Does anyone have any opinions on DropWizard as a framework? Is it the minimalist web framework for Java, similar to Flask for Python?

I've heard good things about it, but my understanding is it's ideal for creating REST endpoints, so it doesn't have some standards MVC stuff out of the box. Spark is a JVM version of Sinatra which may be closer to what you're looking for.

"The dropwizard-views-mustache & dropwizard-views-freemarker modules provides you with simple, fast HTML views using either FreeMarker or Mustache":

https://dropwizard.github.io/dropwizard/manual/views.html

"The dropwizard-forms module provides you with a support for multi-part forms via Jersey":

https://dropwizard.github.io/dropwizard/manual/forms.html

If you can render HTML in responses and accept multipart/form-data in requests, does Jersey become an adequate MVC framework? If not, what is it missing?

Re: Ask HN: What stack would you use to build a CRUD web app on the JVM today?

#162

Earlier quoted context omitted.

I also highly recommend Aurelia. It's a fantastic and future proof front-end library. Out of curiosity, why Spark over Scalatra? ( http://scalatra.org/ )

What makes you say it is future proof?

I assume he's been to the future, that's the only way one could know.

Re: Ask HN: What stack would you use to build a CRUD web app on the JVM today?

#163
post #29

I would not start with technology stack and build around them. You look at your use cases and build out. Pick your frameworks and databases judiciously and as late as possible. Read: https://blog.8thlight.com/uncle-bob/2012/05/15/NODB.html Read: http://www.amazon.co.uk/Growing-Object-Oriented-Software-Gui... [EDIT] Removed the unnecessary/unhelpful opening statement.

For context, I already have a JVM application that handles the business domain. Adding a CRUD user interface (and, coincidentally, a database) is the next step I have in mind for its development. However, I didn't want to state those constraints in the OP because I wanted the answers to be broadly applicable.

you can look at this list of Java awesomeness.

https://github.com/akullpp/awesome-java

Or other awesome stuff at the parent project.

https://github.com/sindresorhus/awesome

Re: Ask HN: What stack would you use to build a CRUD web app on the JVM today?

#164
post #93
post #14

Definitely Clojure with http-kit [1]. Easy to use, minimalist and supports websockets. However, it depends from your use-case. Could add some detail please? [1]: http://www.http-kit.org/

I used to be a big fan of http-kit, but it seems like it's not maintained anymore. I've since moved on to Immutant 2, which seems to offer much more. The primary difference between Immutant 2 over 1 is that it's not monolithic and you can just import what you need. And I believe it's faster too. Also, yesterday I announced that I am writing a book on developing REST API's in Clojure, if anybody's interested in learni…

looking up to it!

Re: Ask HN: What stack would you use to build a CRUD web app on the JVM today?

#165
post #48

First of all, I have to agree with dommer. You pick the stack depending on the use case. That being said, in most use cases I've encountered I would've gone with a REST API on the server for CRUD operations and an SPA framework on the UI side. I've found that the use of a classical UI Framework like Play, Grails or JSF make seperation of UI and business logic harder, rather than easier. Especially Grails is a huge ve…

Grails is great for building a REST API. Especially the latest version. It makes it dead simple. I do SPA frameworks on the front and JSON APIs from the back.

Grails is great to get things done quickly (scaffolding). But if you want to write vendor independent code, Grails makes your life unnecessarily hard by providing a full stack from Database to UI. Somewhere something leaks into the business logic. This is less the case if you can pick and control exactly what Database and REST technology you use. Of course you can ignore the DB part in Grails and plug your own thing, but then, why should I use Grails in the first place?

Re: Ask HN: What stack would you use to build a CRUD web app on the JVM today?

#166

Backend: Scala Spark - http://sparkjava.com ScalikeJDBC - http://scalikejdbc.org Postgres Coming from Rubyland (and AR specifically), I despise writing a bunch of dao/repo code, so I've resorted to codegen-ing my daos/repos. Frontend: Aurelia - http://aurelia.io

> I despise writing a bunch of dao/repo code, so I've resorted to codegen-ing my daos/repos.

Spring Data does this very well, in a fashion partly inspired by ActiveRecord. You define a Repository interface with whatever search methods suit your case; a concrete class is built and injected for you. The same interface can back onto JPA databases, Mongo, Redis and I forget what else.

If you add Spring Data REST, you get a complete RESTful API -- complete with HATEOAS, paging, sorting, searching and HAL -- automagically.

Use Spring Boot and you won't need to do any more than include the dependencies in your Maven POM or build.gradle file.

Re: Ask HN: What stack would you use to build a CRUD web app on the JVM today?

#167

Probably playframework [1] or maybe Spark [2] if it's a really simple app, along with jOOQ for persistence [3]. If I was just writing a REST API, then Dropwizard [4]. The reason I would not choose Spring despite the fact that it is better now than it was 10 years ago is because it still approaches things with the wrong mindset, IMO. The reason JVM technologies are so loathed is because of the stupid, pointless comple…

How do you feel about Spring Boot? It's a very similar concept to Dropwizard: one project that does all the basics out of the box.

Include JOOQ, if that's what you want.

Re: Ask HN: What stack would you use to build a CRUD web app on the JVM today?

#168
I'm actually building one right now using Scala + skinny-micro-framework [1] + Slick and it's going pretty well. Very nicely composable, easy to work with Futures (unlike Scalatra) and very easy to extend to handle new types globally. (Just added an `Option -> response getOrElse 404` and if I need it I can add `actorRef -> Future -> rest-of-pipeline` too.).

http4s and rho also look interesting, but they suffer from the magic operator soup that made dispatch a pain to work with (IMO).

[1]: https://github.com/skinny-framework/skinny-micro

Re: Ask HN: What stack would you use to build a CRUD web app on the JVM today?

#170

Earlier quoted context omitted.

Actually the example I was thinking of is the finder methods which require only an interface definition conforming to a naming convention. Bytecode is generated at runtime - there is no generated source to manage. Not much of what Jhipster generates could be considered boilerplate - the application code is pretty DRY. I've used Rails off and on since 2005 and it is fairly comparable in that respect at this point thou…

It's difficult to take Spring seriously after trying Jersey. Resource traversal is a powerful concept. Also, recent or not, Spring still comes with way too much complexity and magic. I'd really go for something more Sinatra/Flask-like. Haven't tried Dropwizard, but from what I saw it looks a lot more sane.

> It's difficult to take Spring seriously after trying Jersey

I'm using Spring Data REST at work. We have a dozen endpoints. We've had to write code for one of them.

The rest were generated by introspecting our models. Complete with HATEOAS links, sorting, searching, paging and HAL. It made a whole bunch of work simply disappear -- even compared to Rails.

Post reply on HN