Why I Don't Like the Data Access Block (in the Enterprise library, circa Jan 05)

Url: http://wildermuth.com/content.aspx?id=rantview&…

After looking over the latest Data Access Block, i’ll say it is better.  But I still have my gripes:

  1. They are still calling PrepareCommand with an open connection.  Even if you get the parameter out fo the parameter cache, the check with teh Database is still going to happen.  I think a code-gen solution (a la Typed DataSets) for Command objects is a good idea (and Whidbey and I both have different ways to handle this).
  2. There is still no way to update multiple datatables within a single transaction.
  3. There are still issues with Table/Column Mappings in that they are being obfuscated from teh user therefore they’ll never know when they can use them.

It is better in a number of areas though:

  1. Much better connection management.
  2. More more generalized away from SQL Server.  Complete usage of IDb* interfaces helps, but real database independence is a pipe-dream IMHO.

On the whole though, I’d still recommend not using it and rolling your own DataAccess object with some of these ideas, but not most of them.