Fickle Bits

You're doing it wrong.

The Battle of the Data Access Layers

I have heard so many discussions (read: arguments) about which DAL method is the best and nobody ever has a clear-cut case for all solutions.  Previously I have sort of  “rolled my own” data layer, with a simple helper class and some parametrized queries.  This has slowly grown into a very lite version of the Data Access Application Block from Microsoft (which kinda makes me grin, b/c that wasn’t the intent).

The last project I started used NHibernate.  It really did make a lot of things easy, and definitely sped up development.  I was a little weary of the learning curve (which only gets steeper the more complex your schema gets), but I eventually came up with a solid solution that has held up well.  I did have to make certain design considerations using NHibernate, which I didn’t like, but I got over it.

Anyway, I get to start fresh on a new project again and I’m back at the same step:  how should I shape my data layer?  Should I use NHibernate again?  Should I use CSLA.NET?

Here’s what I am considering:

  • My own hand-made DAL.
  • CSLA.NET
  • Use Enterprise Library (specifically the Data Access Application Block)
  • NHibernate

Right now I’m leaning toward CSLA, because I think it might integrate quite nicely with a large project we currently have, where the DAL it uses (well, only about 25% of the code even uses the middle tier) is sort of primitive. (anyway, don’t get me started on this, it’s a mess that needs to be cleaned up)

My goal is to provide a boilerplate DAL that ALL of our upcoming projects can utilize effectively (large or small).  Any suggestions?

Comments