Hibernate Should be to Programmers what Cake Mixes are to Bakers

Hibernate Should be to Programmers what Cake Mixes are to Bakers

Cake mixes consist of a mix of things you already have in your cupboard plus a load of unnecessary, potentially harmful preservatives. They cost more than making cake from scratch, the resulting cake tastes worse, they take away people’s confidence in their ability to make their own cakes, and they don’t even save you any time. Hibernate has the same misperceived benefits and the same draw-backs. Gordon Ramsay wouldn’t be caught dead using any cake mix. As professional programmers, we should be more skeptical of generic frameworks like Hibernate.

Video Producer: JavaZone Conference

3 Comments

  1. Pingback: Links for November 4th — Vinny Carpenter's blog

  2. Jess

    Misses the key benefits of using JPA:
    – Ability to modify/refactor object model quickly and seamlessly at the Java-to-DB layer
    – Drastically reduces bugs in Java-to-DB code
    – Consistent programming model for team members

    Also, the performance card is so easily played, yet rarely proven out. JPA has ways to avoid performance issues, including caching, lazy loading, and support for native queries (if needed).

  3. “As professional programmers, we should be more skeptical of generic frameworks like Hibernate”
    Seriously? So we should keep reinventing the wheel every time we need to interface with the DB, wasting clients’ time and money in the process? How’s that professional?
    Do you have any proof or example of any kind to back your claims up or did you just have a bad experience with Hibernate and decided to share it with the world in the form of misguided blog post?

    1. They cost more than making cake from scratch,
    Cost more how? In terms of memory? Speed? Money?
    Hibernate is free. It’s memory footprint is quite small while the SQL it generates is pretty tight. It provides a level caching out of the box so it’s performance might even be better that what you’d get with a custom JDBC solution. The chance of bugs is also incomparable. It’s been developed for many years now by professionals, you know. Think you can do better?

    2. the resulting cake tastes worse
    So cobbles of JDBC code “taste” better than cleanly annotated classes? Care to explain?

    3. they take away people’s confidence in their ability to make their own cakes,
    Maybe it takes away your confidence, it certainly doesn’t take mine. I actually know what I’m doing.

    Btw, all frameworks are “generic frameworks”, otherwise they’d be applications and not frameworks at all.
    Are you suggesting we should eschew web frameworks as well (’cause, you know, they’re generic) and code servlets directly?

    In conclusion, no, Hibernate should not be “Cake Mixes”. It’s a tool, and if you’re not one too you should learn to use it properly.

Comments are closed.