tags:

views:

96

answers:

3

Possible Duplicate:
Why should you use an ORM?

Can someone provide a simple explanation to prove ORM is worth it?

EDIT

as for duplicate issue,I want the answer to be with some code demo to illustrate.

A: 

The biggest benefit for me, is that you don't need to deal with SQL string statements. If a new field is added, renamed, or removed, then you can see the lines of code that need to be modified. If you're using SQL strings, then you have to search through the code and manually find each instance of the line of code that needs to be updated. If you used to do database access via SQL strings, then you know how much of a PITA that is when the schema changes.

Since the field names and table names are in the code, you can see errors at compile time rather than have to build and deploy the app to test it against the database. So it makes testing and coding a lot easier/faster.

Jim W
A: 

There are many benefits, just outlining a few:

  1. Productivity – ORM reduces the burden of developer by providing much of the functionality and lets the developer concentrate on business logic.
  2. Maintainability – As ORM provides most of the functionality, the LOC for the application will be reduced and it is easy to maintain. By automated object/relational persistence it even reduces the LOC.
  3. Performance – Hand-coded persistence provided greater performance than automated one. But this is not true all the times. But in ORM, it provides more optimization that works all the time there by increasing the performance. If it is automated persistence then it still increases the performance.
  4. Vendor independence – Irrespective of the different types of databases that are there, ORM provides a much easier way to develop a cross platform application.
Anand
A: 

All that is true, and if you are looking for one in Java - I should recommend Hibernate. Its cross-platform and you can integrated with ESB's and Java server pages.

WuD