Tuesday, September 20, 2005

Hibernate, ActiveRecord and SQLObject

O/R mapping is still a hot topic. For Java developers, Hibernate is a very good choice. It's relatively easy and very powerful. Recently, dynamic programming language users claim they have some even easier solutions to accomplish the same task.

Active Record is an O/R mapping tool written in Ruby. It's also a important component of the HOT "Rails" framework. David Heinemeier Hansson, the author of Rails, wrote a blog to compare Active Record and Hibernate. The application he tries to mimic is the a book sore example mentioned in InformIT's hibernate tutorial. Ian Bicking, the author of Python based SQLObject, also provides his book store implementation based on SQLObject. Just look the code, these two implementations look very similar. Both have less LOC than the hibernate version. Nice work!

So, does this mean Java developers have to suffer bad productivity? Not really. With JDK 1.5, Spring framework, hibernate annotation and Eclipse, java developers can get high productivity, too. Trails is a good example. It learns from Rail and reuses some of Java's best frameworks. Give it a try, it's pretty cool!

Ian points out there is a nice presentation which compares SQLObject and Active Record in details. Thanks, Ian!


At 9:48 AM, Blogger Ian Bicking said...

Ben Bangert also compared ActiveRecord and SQLObject some in a recent presentation (it's towards the end):

At 11:58 AM, Blogger Yan Weng said...

cool! The presentation is very helpful. Always mapping SQLObject to table may be a drawback in real enterprise application. However, we can work around it by using View in database or another model object in Python code.


Post a Comment

<< Home