The Future of ColdFusion Part 3
Sunday June 22, 2008 8:47 PM
Word Count: 1044
The final feature I want to talk about and probably one of the biggest is native ORM via Hibernate. If you have never heard of ORM it stand for Object Relational Mapping. If you want to learn more there are 2 projects for ColdFusion in the ORM market Transfer & Reactor. While its possible to use hibernate today its a very manual process and like everything else in ColdFusion they want to make it as easy as possible to use. So what is hybernate, this a quick intro straight from the site.
Databases are the core of all ColdFusion applications and integrated ORM in Centaur will dramatically simplify data integration. The basic idea is that by using hibernate all you would have to do is tell a cfc the datasource and turn orm on it will create all of the sql needed for you. This means for basic crud applications you will no longer have to go in and write/generate 4 methods for every table in your database. Here is a quick example of the code Adam showed. This is the least amount of code you need to persist a cfc to the database.
Here is an example of using the built in ORM. You will notice that we have all the implicit getters/setters and you would be able to call the save method that you never wrote!
A pretty cool feature that Adam showed is the configuration file for hibernate. They use pretty much the same configuration file as hibernate. If you were to go ahead and dump the object straight to screen you would see all of the getters/setters along with all of the component methods. With everything else they are adding your code will still work the same and this is only an option. If your not a fan of ORM than don't bother using it.
I have to admit that I have never used hibernate so I may try and download it and hook it into ColdFusion so I can how it works. I have used both Reactor & Transfer before and they are both great products so if you have not used an ORM yet I would check it out. Ben also stated that if you have ideas on how this should work / implementation / features then you should blog about it or even email them about it. These are 2 really great features and I am looking forward to seeing what the community thinks about it. I also learned from the keynote that ColdFusion 9 will ship in 2009 so we are not that far away. I am also curious about something else Adam mentioned, he said that it is a small peice of a much bigger puzzle. Any ideas on what he is talking about?
