Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Criteria to use Hibernate in your design

 
saurabh sharma
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

can anyone tell me the various factors which one should consider while deciding whether to use Hibernate or not?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've asked a pretty big question. You might get a better answer if you asked everyone if a Mac was better than a PC, or if Windows was better than Linux. These are all questions you can debate about and never get anywhere.

It all depends on YOUR needs, and YOUR problem. Do you need ORM? Can you use just JDBC? Do you have skills to maintain this over time?

You really have to come up with your own criteria. What do you need? Find out what you need, and then see which strategy best fits your need.

Here's a long, arduous and fun thread that pretty much went nowhere and should have been closed by the admins , but it's fun to read, and it might help you come up with some better questions:

JDBC is all you need. Never Use an ORM like Hibernate to Access a DB: IT'S WRONG!

-Cameron McKenzie
 
Fan Kai rui
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JDBC is all you need. Never Use an ORM like Hibernate to Access a DB: IT'S WRONG!


From my experience, I agree. I don't particularly like ORM frameworks on top of JDBC for the following reasons:

-Most (if not all) JEE developers know sql to some extent and can support existing JDBC code. It doesn't have the cool factor of the latest framework, but everyone can deal with JDBC.

-JEE developers get fixed on finding solutions in the ORM tool instead of optimizing queries or DML at the database level. Sometimes the ORM solutions introduce their own complexities for optimization. Yes, there are ways to optimize the ORM queries, but that just added another layer of complexity to finding the solution to your business problem. I'd rather just interact with a stored procedure written by a competent database programmer...let them deal with optimization issues.

-I get a lot of junior developers on my projects. If I put ORM tools in front of them, then I just created an enromous amount of overhead for myself since we get to experience the "joy of building the code together". If they can't make it through JDBC code, then they get removed from the project with little pushback from management. If I cripple my team with technology they can't handle, then guess who gets removed from the project? You need to make sure to evaluate your team's capabilities before introducing these frameworks. Have a stellar team of developers? Then go for it!

One framework I have found of value is the Spring JDBCTemplate framework. You get to use JDBC, there's no ORM to worry about optimizing, and most of the tedious portions of JDBC (did you remember to close that connection on your finally block???) are handled behind the scenes. It's simple and effective. Actually, the simplest tool I have found for JDBC is using BEA (Beehive) Controls. I've handed them off to many developers and they pick it up in no time.

Greg
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic