Hibernate, presented

· by Steve · Read in about 4 min · (695 Words)

I reprised my former role as ‘wizened business software guru’ last night by giving a presentation to my local developer community on Hibernate, the Java-based object-relational mapping system (ORM). I really like Hibernate; not only has it got an enormous amount of features, and performs really well, but it’s also built on very sound design principles. As someone who has used several ORMs in the past, and written a couple of my own going back a decade or so, I can appreciate the thought that has gone into it.

I think it went down pretty well - I discovered I had a bit too much to cover when I did a timing dry-run so had cut a few things out at the last minute, but I still had to get my skates on to keep it at around an hour - I hope people didn’t feel too bombarded. I really just wanted to get across just how mature frameworks like Hibernate are; most of the local developers are .Net-oriented and thus being a fan of Java for business software I sometimes feel I have to defend it, now that it’s no longer ‘trendy’ - it may not have all the latest language-level gimmicks, but in terms of robust, tested and feature-laden frameworks it still leads the pack - if you’re building something non-trivial I don’t think there’s a better place to do it. I think it’s easy to concentrate too much on low-level language issues (which .Net scores very highly on indeed), and not enough on the wider supporting ecosystem - language tricks and tool integration make a development environment feel more productive, but there’s simply nothing more productive than not having to write the code in the first place! Java still gives me the most confidence that I can just use plenty of existing standards and frameworks and assemble a decent sized application without hitting things that aren’t finished yet. Plus, I like that it’s fully cross-platform with a huge amount of open source support of course. I briefly covered NHibernate (.Net port of Hibernate) at the end of the talk, which like most .Net ports of Java software lags behind the original and misses a few features, but is still probably one of the best ORMs you can get in that environment at the moment. LINQ to Entities may eventually squash it of course, once it matures enough - again I have to shake my head at Microsoft’s ‘Not Invented Here’ attitude that will cause them to have to recreate all of NHibernate’s features, and thus put their users through a year or more of shaky maturation, compared to if they just adopted, wrapped, enhanced, or provided support for NHibernate. But we know they don’t play well with others 😉

I was pleased to see a couple of people from our local Mac store came along too, who had apparently done some Java coding before. I actually did the entire presentation (including demo) on my MacBook Pro using Open Office and Eclipse - gotta love cross-platform, open-source software. I developed both the code and presentation hopping back and forth between Windows and OS X, depending where I happened to be on any given day - I love that I can do that seamlessly with these tools. And of course Eclipse is a delight to use, one of the few tools around that can beat the living daylights out of Visual Studio.

I managed to squeeze in a few bits of from-the-trenches design advice along the way to explain why I’d advise doing things certain ways - and I was quite surprised at the number of blank faces when I brought up things like the Law of Demeter and the n+1 selects antipattern. I guess I’m a bit of a design geek anyway, but this is the sort of stuff that really does affect software quality and performance in decent sized application, so I hope the nuggets were useful to someone.

Anyone who wants to look at the slides can do so here. To recreate the entire experience, just imagine a short bearded guy talking way too fast and waving his arms about. 😉