Wednesday, March 30, 2011

Object-Relational Mapping

Basic idea of Object Relational Mapping(ORM) is converting data between incompatible types in oop languages.When it comes to data bases it is about creating creating virtual data base objects which can be used in object oriented programming.




Above diagram clearly explains the task of ORM mapping. To get the overall task done first we need to select a good data base driver which create the connection between our program and the data base. this method is efficient than manually create data base connection every where and close the connection.(Better to hand over db connection creation part and closing part to a middle man so that we can have a more readable code) This is a good tutorial to be familiar with jdbc templates. Also it is good to use spring hibernate for ORM modelling so that we can implement our program in a configurable manner using XML based technologies. Following diagram explains clear overview about spring architecture.[reference]



But still we have to do some boring coding part for mapping objects classes for the data base tables.In this context i recommended you to use apache cayenne which auto mated the class implementation. Here we just have to use UI and create needed tables and mentioned the relation ships (one to one or many to one etc.). And also we can mentioned data base drivers and create data base in our disk. Here is the official tutorial provided by apache cayenne team which is very interesting one.

By using above technologies you can easily work with data base programming which was a really boring and harder task earlier.So now companies do not need special type come data base programming developers. istead it can be handle by normal oop programmer.