My Last Rant about Stored Procedure Abuse

At the request of one of my colleagues –


“There should be more classes than stored procedures”


        — Gary Williams


EDIT 10/28/2005 – Just to make this more specific, let’s say there should really be more LOC in C#/Java/VB.Net than in T-SQL or PL/SQL

About Jeremy Miller

Jeremy is the Chief Software Architect at Dovetail Software, the coolest ISV in Austin. Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy is the author of the open source StructureMap tool for Dependency Injection with .Net, StoryTeller for supercharged acceptance testing in .Net, and one of the principal developers behind FubuMVC. Jeremy's thoughts on all things software can be found at The Shade Tree Developer at http://codebetter.com/jeremymiller.
This entry was posted in Ranting. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • Gary Williams

    SPROC bad, code good. Can put code in service layer. SProc not do service layer. SProc not translate if change database. SProc not refactor easy. SProc hard to test.

    Me no like Sproc.

  • http://codebetter.com/blogs/eric.wise Eric Wise

    I use codegen for everything I possibly can.

  • http://codebetter.com/blogs/sahil.malik sahilmalik

    In my opinion, single table CRUD can definitely be automated.

    Multiple tables – you have interesting issues to worry about.

  • DawlinLi

    OMG, the senior developer here do EVERYTHING in stored procedure, business/validation, you name it. The only .NET component is straight data translation, that’s it.

  • http://mo.notono.us Oskar Austegard

    In a data-driven application, business logic will often migrate from classes to the stored procs for performance and data integrity issues… Typically only the R is generic – the CUD may be much more complex.

  • Jeremy D. Miller

    Either way, human beings shouldn’t have to be toiling away writing generic CRUD sprocs by hand. Been there, done that, moved on.

  • http://codebetter.com/blogs/sahil.malik sahilmalik

    Then don’t do stored procs for simple CRUD :)

  • Jeremy D. Miller

    Ok, I’ll clarify then –

    More classes than stored procedures that do business logic.

    Do you use codegen for the sproc’s?

  • http://www.codebetter.com/blogs/eric.wise ewise

    Er?

    If I have a customer class, and I use stored procedures for my CRUD, then I’m already at 4:1.