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.









February 27th, 2008 at 1:10 pm
*delurks*
I didn’t know about the law of demeter nor the n+1 selects problem, so I followed both links out of curiosity. However, in just the same way as when I leaf through another one of those books on patterns, I am struck by how obvious some of these concepts are. Simple concepts with names almost annoy me as much as when XML is referred to as a “technology”. It seems to me a dilution of common sense, if you will.
I understand of course that the naming of concepts enable us to talk about them, but surely everyone can figure out at least the basics on their own? I must confess that it still surprises me a bit when I discover that yet another programmer colleague neither learned assembler at an early age nor spends most of his or her free time in front of a computer.
So much for the ranting; on a more serious note, I enjoy reading your blog and I’m greatly thankful for your amazing contributions to the opensource community.
February 27th, 2008 at 2:13 pm
Most design concepts are obvious when you know them, but I’ve met plenty of people who aren’t aware of the principles and haven’t discovered them for themselves yet. Cataloging patterns / techniques / guidelines at least means we can debate them more easily, and teach them to new programmers without them having to go through the same repetetive thought processes all over again. It’s the nature of passing on and refining knowledge - you need nomenclature to allow you to move beyond describing something to communicating or debating it effectively. I know what you mean when it comes to marketing language used to describe simple things, but this isn’t the same thing IMO.
Glad you enjoy the blog
February 28th, 2008 at 4:13 pm
I also dislike communicating concepts using obtuse and seemingly arbitrary labels. My chief concern is that the labels say nothing about the concept. “Law of Demeter” means as much to me as “Betula medwediewii”. Instead of a diligent cataloguing for educational purposes, I get the impression of a secret society or a subculture that uses made up terms as a means of identifying fellow members and distance themselves from the uninitiated.
Of course I’m fully aware that my aversion to labeled concepts may be purely irrational, but like João I feel that labeling can sometimes go overboard. Not just when it comes to market speak. I don’t want to sound like an obnoxious elitist nerd and receive blank stares, so I don’t talk about concepts using their labels. I find that plenty of people are aware of the principles, but not the labels.
Disclaimer: João is my brother.
February 28th, 2008 at 4:25 pm
Ok, so how would you personally refer to the design concept that the LoD refers to, in a conversation? I don’t see how you would without having to actually explain what it is, wasting your time and the listeners if they’re already familiar with it.
What the names are is irrelevant. It could have been called the Pinkerton Principle for all I really care - all that’s important is that once a number of people identify what it is, and agree on a name, it becomes more efficient. I can talk about patterns like ActiveRecord, Observer etc and most listeners know exactly what I’m talking about instantly with no long explanations.
When terms delude, fine. But when they’re just identifying something that would take far longer to explain in descriptive terms, they serve a practical purpose. Even if some members of the audience didn’t know the term, next time they will and it will save time for all concerned.