Mudassir Shahzad

Enterprise Software Development

Why Hibernate should be chosen for projects ? Advantages of Hibernate

Why Hibernate should be chosen for projects ? Advantages of Hibernate

I have been working on various projects in which I used hibernate in many projects. However, when in an interview, I was asked about why one should choose hibernate, I thought I should put together the benefits and the reasons to choose Hibernate.

What hibernate is basically ?

Hibernate is an O/R mapping which stands for Object/Relational mapping. This means that hibernate relates/maps objects with the database tables (also known as relations).

 

Why O/R mapping ?

 

1. Productivity

The developer no more need to write all the SQL manually using the JDBC API. It also helps the developer to concentrate on the business logic of the project instead of giving time to manual SQL queries and the consequent bugs in it. This helps increase the project productivity.

 

2. Maintainability

It generates the necessary SQL queries on the backend, making it easy for the developer to maintain the code.

 

3. Portability

Hibernate is portable. Regardless, of the database, you can write your code and run it with every database just by making a few change in the hibernate configuration file.

 

 

Why Hibernate should be chosen over other O/R mapping technologies ?

 

1. Productivity / Maintainability / Portability

Hibernate provides all the above mentioned O/R mapping features.

 

2. Its Open Source

Hibernate is open source and companies who tend to work using open source projects can benefit a lot from it.

 

3. Its Popular

Hibernate is a popular O/R mapping and there is a lot of support for bugs. It has been used in many projects, so there is a 99% chance that if you come across an error or problem using it, you can find it solution on the internet as there are many discussion boards and websites writing about it.

 

4. Easy to learn

Hibernate is totally object oriented and it is easy to configure and learn.

 

5. Code generating tool

Many popular IDEs (Netbeans, Eclipse..) provide support for code generation. If you have created you database, you can generate hibernate objects for all the tables with the click of a button.

 

 

 References

 

Hibernate code generation

http://www.hibernate.org/255.html

http://www.hibernate.org/hib_docs/tools/reference/en/html_single/

http://wiki.netbeans.org/ReverseEngineering

 

Mudassir Shahzad

Website:

7 comments

Tehmeena Ansari

Hello admin.

I am very pleased to see such a nice article.
You are very good at what you do.
Keep posting more nice articles.

Thanks again.

Usman Azam

Very nice article. Clears everything.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.