Don’t use stored procedures yet? So what?

I think most people arguing about stored procedures are missing the point. The most important aspect revolves around a clear separation of concerns.

  • “At just about every talk I give I always try to make several consistent statements. One of which is: ‘Whenever possible use stored procedures to access your data’.” - Rob Howard’s Blog
  • “Let me start with a blunt statement: stored procedures are bad, they are a bad way to formulate data-access logic. ” - Frans Bouma’s blog
  • “In my experience, this debate comes down to a mindset. If you are fundamentally database-focused, you will like stored procedures. If you are fundamentally application-focused, you will not.” - Ned Batchelder
Each of these people has a very good argument, however instead of arguing they should be looking at where they are in agreement. Separating data access from business logic is a good thing.
  • “. . . one of the ways we solve this problem is by using the provider model pattern: a pluggable data access layer” - Rob Howard’s Blog
  • “However the alternative is not stored procedures, it’s a component . . .” - Frans Bouma’s blog
Lets stop worrying about the pros and cons of stored procedures, lets focus on making good software. This means that we have clear separation of concerns. I don’t care how that is accomplished so long as there is no business logic in my data access layer.

In an upcoming post I’ll try to find some code that shows how your business logic can leak across boundries without your realizing it.

Leave a Reply