Wednesday, April 4, 2007

Four Golden reasons to use O-R Mapping frameworks

O-R mapping frameworks(Toplink from Oracle,JDO from sun, Hibernate from Open source community) are around for quite long period of time. These lightweight frameworks simplify the development of persistence layer in a J2EE applications. I filtered down to four golden reasons for using O-R mapping frameworks for any J2EE applications.


  • Portability across databases
  • Support for Transaction management
  • Business logic can be unit tested without deploying it to the container
  • These objects can be directly consumed by the presentation layer without writing the additional DTO(Data Transfer objects).

The O-R mapping persistence layer can be easily migrated to almost any database by just changing the descriptor file. The benefit of using O-R mapping tools over EJB 2 is that , its not required to be deployed on container for unit testing of your business logic, moreover these objects can be used by the presentation layer for the presenting the data which avoids need of additional DTO objects.

There is good article on javaworld about J2EE design decisions which very well explains the importance of O-R mapping frameworks.