Hacker News new | ask | show | jobs
by hibikir 4412 days ago
I am especially fond of his view on database layers. There's JDBC, which is extremely verbose and needs scaffolding to make it usable, and then ORMS, that will quickly fall apart the moment you actually need to do anything interesting with the database.

The Spring solution to this problem was always my favorite part of their stack: JDBC template removed most of the error prone boilerplate from JDBC, adds a couple of features, and still lets you write SQL directly, which is probably what you should be doing in almost all the cases where a relational database becomes valuable.

I can't wait for shops to start to use Java 8. The removal of so much boilerplate when trying to build functional interfaces should make the Java toolsets move forward very quickly.

3 comments

Again, just use jOOQ. It's beautiful executed design, written by smart people.

http://www.jooq.org/

I never cared for the library until I realized I'm spending a lot of time on the developer's blog; he is prolific and very knowledgeable about everything database and java. Was sold on it soon after.

That is precisely why I created this little project. It generates the boiler plate code to leverage jdbcTemplate and organize the data access objects.

http://huherto.github.io/springyRecords/goals/

Also, this fellow HNer has been experimenting with Java 8 features. Pretty cool. https://github.com/benjiman/benjiql

I think myBatis does something similar, abstracts JDBC and lets you write SQL easily.