This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate doubt

 
sunitha chekuri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In what kind of applications should we use hibernate.Could someone tell me its advantages.
I noticed in hibernate for each table in the database we need to have a an xml file and a Java POJO.Is it not an overhead?
I feel using JDBC to query the database more comfortable.But I might be missing something about it.I am new to J2ee technologies and have come up with this doubt when started learning hibernate.
Thanks in advance.

suneetha.
 
Wagner Danda Da Silva Filho
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I see a simple advantage of using Hibernate (or any similar): you'll just work with objects in your code, the code looks cleaner.

Besides that, Hibernate does the hard work of persisting the objects (he does the inserts/updates/deletes for you).

Also, the part of creating the XML and POJO files is already automated by many tools (see Hibernate Tools for Eclipse).

The counterpart is if your app is too focused on database procedures, then I think you wont get too much benefits from Hibernaate.

[]�s
Wagner Danda
 
sunitha chekuri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Wagner,
Thank you for your response.I seem to understand it, but I may feel the difference when I really work on a hibernate project.

After I posted this I found a very well written Return on Investment article on hibernate.This is the URl.

http://www.jroller.com/page/gursesl/print/p_class_msonormal_span_style

Thanks,
suneetha
 
Levent Gurses
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sunitha,

While Hibernate is definitely a good option to research, you should know that it is not the only one. iBATIS for instance is another widely supported framework framework for Java and .NET. iBATIS couples objects with stored procedures or SQL statements using a XML descriptor. What it brings on the table is simplicity. Now, arguably Hibernate is also based on simplicity. So, do the research, run two small prototypes and see for yourself.

On the features side, with iBATIS Data Mapper, you rely on your own objects, XML, and SQL. So, it claims to give you greater power of both SQL and stored procedures for your business logic. Whether you want to put business logic on the data layer is another question that only you can answer.

Sincerely,
 
Sabarish Sasidharan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Levent Gurses:
Sunitha,
On the features side, with iBATIS Data Mapper, you rely on your own objects, XML, and SQL. So, it claims to give you greater power of both SQL and stored procedures for your business logic. Whether you want to put business logic on the data layer is another question that only you can answer.

Sincerely,


Sunitha, If you love SQL, comfortable with it, then use iBATIS. It is the simplest framework and is quite easy to get started with. When using Hibernate, expect a steeper learning curve.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic