The other night I attended a seminar given by James Kovacs for the Calgary .NET user group. Essentially the topic was Persistence Ignorance (PI) using NHibernate.

I am more focused on application functionality, domain expertise, application usability and user interface design than what is underneath the hood. I leave the coding to the developers I work with.

Nevertheless, I have always been a proponent of separating the user interface, business logic, infrastructure plumbing and database (persistence) and not mixing the concerns unless you have to. I love the idea that loose coupling, programming to interfaces and good tests can reduce risk when making changes to the application. Great software continuously evolves and grows as domain experience increases… it is very seldom born that way (great or static) at a point in time.

James covered the theory behind PI and domain driven design (DDD) quite well and explained how NHibernate could be used to specifically address these concerns (with lots of code samples). The theory and the promise of the methodology (PI using an Object Relational Mapper (ORM) tool) resonate well with me. What really sat well with me was his admission that you can not be a good developer and be totally oblivious of the database (no matter how good the ORM tools), as database and network performance in the real world are still a concern… good code design needs to reflect the real world.

This matches my view of the world, that the master developers are adept at using a number of tools, understand the entire stack (well enough) and know when to apply the right tools for a given situation. You can specialize, but a developer who doesn’t care about the user interface at all is just as limiting at some point as one who is oblivious to databases and networks.

A while back (before NHibernate matured) we developed our own data access and then more recently, ORM tools (they’ve evolved into a decent tool). However, times change and it likely does not make sense to keep moving it forward with other robust options now available.

Ultimately it comes down to mastering the theory behind robust and flexible code design. Whether it’s NHibernate today or another tool tomorrow, we will be using an ORM so we can focus on building great applications, not the plumbing. We’ll also take the time to understand “what” we are doing… and most importantly, who we are doing it for.