As a bit of a background, I am a Java programmer with 2 years of experience. We have written a couple of database driven web-apps using Struts. All of our database code was self written (connections, sql statements, etc).
We are starting a new Java project and have decided to take a look at hibernate. The thing is that our project is read-only from the database. We have nothing to write back to the database. The reason we would like to use hibernate is to get our feet wet with the technology and to get some of the benefits of using a robust db access framework (it manages connecting, connections, etc).
My question is: Is hibernate overkill for a read-only web application?
There are only 10 types of people in this world... Those who understand binary and those who don't.
Originally posted by Cory Max: We have about 20-25 tables and would be subject to minor change from time to time.
PS. Why would you write your own ORM tool in VB?
Because I got tired of writing String statements all over my code, when I can create a Class object and pass it to one method for all my tables. I just mapped my tables to the individual table class to the fields and it would automatically write the SQL for me, instead of many String sql statements typed by myself. This was VB 6.0
So knowing Hibernate, I know I could create the mappings with Annotations and a Generic DAO class is one week, and never write JDBC code again for an app with 20-25 tables.
You might find hibernate to be slower than writing jdbc directly. In general when dealing with 'object' stuff, speed of development is more important that speed of code. at least in the beginning.
I don't think hibernate manages connections that much. It will abstract away managemetn of jdbc connections, but the notion of connection will still exist in your application. There is some benefit to letting hibernate do that for you, but its not huge. However, it does grow as hibernate grows. Same with ORM.
I don't see any reason not to use Hibernate. It wont hurt anything and the time to deployment will probably be faster than if you wrote jdbc directly.
Joined: Jul 20, 2005
Thanks for the replies folks. I spent 2 days reading on Hibernate and got a few examples to work. In the end I scrapped the idea for a few reasons:
- Timeline is very important on this project (and on every project I guess) - New technologies (for us) present risks in terms of learning time and reduces our ability to solve problems quickly. - We have a few developers that would need to get up to speed on this stuff fast and that didn't seem like a reality that could be achieved without someone to mentor us.
The coles notes of it are that the learning curve was too steep for us on this project compared with the benefits.
PS. In the end, wrote our solution using the DAO Pattern from the GAF and implemented connection pooling using C3P0 (which is the same open source connection pooling that hibernte uses).