The last time Hackerfall tried to access this page, it returned a not found error. A cached version of the page is below, or click here to continue anyway

How Hibernate Almost Ruined My Career

How Hibernate Almost Ruined My Career

java and hibernate | Sep 27, 2016 | Interesting? Share on Twitter, Facebook, Google+, LinkedIn

Imagine that you are a Java developer, and youre about to start your next big project. You need to make the fundamental decisions that will stick with you for the rest of the project. You want to pick the best object-oriented abstraction of your flexible data model because you do not want to deal with plain SQL. You want to support all kinds of data, and ideally, support all sorts of databases.

The obvious answer is to just use Hibernate, right? 90% of Java developers would agree with you, but does that make it the right decision?

Lets take a look at what can go wrong if you blindly use Hibernate just because its the accepted standard.

Consider Monica, a Java developer. Monica has recently been promoted to the role of architect and is now responsible for laying out the technology stack for a new product at her company. She knows that in the Java world there is only one good tool for handling database communication: Hibernate. Hibernate is a well known and supported JPA standard. However, it is always a good idea to check a few things before starting a project. Fortunately, her colleague, Ben, knows the right guy.

4 Years Ago, Hibernate Sounds Like A Silver Bullet

3 Years Ago, Growing Pains With Non-Flexible Solutions

2 Years Ago, Were Now Hacking Together Solutions In SQL Again

2 Weeks Ago, Giving Up On Hibernate

Today, So Whats The Lesson Learned?

Wrap Up

Monica is a Hibernate expert. However, Hibernate in this instance was a wrong decision. The moment she discovered that her solution turned into a bigger problem than the original, it was the largest threat to the whole project.

Data is the central purpose of the application and, like it or not, affects the entire architecture. As we learned from the story, do not use Hibernate just because your Java application is using a database or because of social proof. Pick a solution that embraces flexibility. There are plenty of options for robust JDBC wrappers, such as JdbcTemplate or Fluent JDBC Wrapper. Alternatively, there are other powerful solutions, such as jOOQ.

See what people say about this article on the Toptal or Reddit page.

Like it? Share it on Twitter, Facebook, Google+, LinkedIn

Continue reading on