Hibernate vs iBATIS

May 1st, 2008

The question of Hibernate or iBATIS seems to come up all of the time. I think Hibernate and iBATIS serve two different purposes. Hibernate is great if you don’t really need to worry about the data model that you are accessing. That is, you have an Object Oriented application and want to map that OO design into a persistence layer. For the developer, Hibernate makes this simple and transparent. It’s easy for a Java developer to build an application using Hibernate. It is an Object Relational Mapping Tools (ORM) and you generally
end up with a plethora of tables that map directly to the objects in your application.

iBATIS on the other hand is useful when you really do care about the underlying database schema. For complicated analytics this is generally the case. You really want to layout your data in a way that lends itself to the types of questions you want to ask of the data. In this case, that doesn’t necessarily map to your OO design. iBATIS allows you to map this schema into your Java objects, and thus is an Object Mapping tool. Rather than a one to one mapping of table to object, you map your Domain Model to a number of objects, where this may be an m to n mapping.

Futher, iBATIS externalizes the SQL that you are going to use to perform the query into an XML file, meaning that it is much easier to change your queries as you fine tune your schema. It’s really the same SQL you would use in “insert your favorite sql tool here“. Yes, Hibernate does support hsql, which gives you more control, but I still find that to be a tool that people use when the default ORM mapping doesn’t work.

So the question for me really drives to: do you want to create your Domain Model in the database and access it from Java, or do you want to create an OO model in Java and persist it to a database? Once you answer that key question, you can choose which of the two technologies to use.

Technorati Tags Technorati Tags: ,

Jira Issues on my desktop

October 27th, 2006

132-JIRAWidget-2.0-black.jpg
Since I seem to have committed to the Yahoo Widget Engine (see my earlier post about RSS Readers) I thought I’d see if there was anything that could help me keep track of my JIRA issues. Of course there is! The Jira Issues Widget by shinetech is just what I needed. And it’s almost perfect. I can easily see what my open issues are (or use any other filter for that matter), and click through and update them in about 30 secs. The only thing I don’t like about it is the amount of real estate taken up by the header and the footer. They could be made a lot smaller and more subtle. Still, can’t complain too much eh?

Technorati Tags: , ,

Lava lamps tell the build story

October 12th, 2006

132-lavalamps.jpg
Since we’ve began using the awesome Pulse build server to automate our continuous integration process the whole team and company has been getting hooked. Most people have just been getting the email notifications, some of the more advanced are using the RSS feeds. But then along comes Hal to take notification to the next level, lava lamp notification!

Sweet huh? This hack brought to you via Pulse, Ruby, X10, REST and some good old lava lamps. You can find Hal’s write up here.

Technorati Tags: , , , ,

Pulse: Continuous Integration made easy

August 14th, 2006

I’ve been a huge fan of utilizing a CI build tool in my development teams for a while now. I tried cron+ant, cron+maven, CruiseControl, Anthill. They all did a good job, but something was always missing. Well, look no further than Pulse from Zutubi. This is a truly fabulous product. Easy to set up, easy to use, easy to get everyone in your team hooked. In less than 10 mins I had a server setup, pointed at my svn repository and checking for commits. Any breaks in the build or unit tests result in immediate mails to the developers.

Is that the only reason why it’s better? No, there are far too many to mention here. Check out this list. But one of the main reasons I love it is that the developers are so responsive. I’ve been testing the 1.1.x beta versions for a while, and every time I try a new version and I find a bug or think of some new feature, I only have to fire Jason or Daniel an email and the idea generally appears in the next version. So far they’ve added LDAP support, Jira linking, Fisheye linking and better installation/configuration for me. Well, I say me, but of course, it’s for everyone ;) It’s a great example of a small company really listening to what their users have to say and acting on it quickly. Kinda like open source no? Did I mention you can get open source or small team licenses too? Genious!

NIO Rocks!

August 12th, 2005

Java NIO
I recently picked up the Java NIO book to gen up on the NIO support in Java. Although it’s been around for a while, I’ve never had to really use it in anger. But for a project that I have going at the minute, I need to do some really performance critical stuff with very large files. Seems like NIO is the way to go.

So far I like the book a lot. It’s well written and clear, with a good structure that adds complexity as you go. I chewed through the first 100 pages in a day (with only a little brain damage!) and based on that was able to whip together my first prototype. Compared to an implementation using the regular IO classes, it’s currently 30-40% faster!! Not bad for a first attempt.