CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeremy D. Miller -- The Shade Tree Developer

Under the hood and working with .Net, TDD, Software Design, and Agile Stuff

Apoplexy

Like many historically Microsoft development shops we struggle with grossly inappropriate usage of stored procedures (every single MS development shop I've worked in or consulted for had this issue to some degree or another).  Part of our "rules engine" varies by configuring the name of a stored procedure per customer for a certain data validation.  The sproc's are edited and deployed outside of any kind of disciplined, consistent process.  We *really* want to get rid of these things, but in the meantime, it's spawning some great internal quotes. 

"If we can't get rid of the stored procedures, can you build us a 'Stored Procedure Writer' tool?" - Yes, we'll call it Query Analyzer

"They're just stored procedures, they can't do any harm" - My jaw hit the floor.  It's a running joke in the office now.

"It's easier for my guys to write stored procedures than have to edit code somewhere" - that one might have been true in the past, but it was a sign in bright pink neon letters that the code *really* needed some serious love.

 

 

Now listening to and torturing my colleagues with:  What's new Pussycat? by Tom Jones


Published Feb 09 2006, 11:09 AM by Jeremy D. Miller
Filed under:

Comments

Liang said:

It is pretty culture issue as Jeremy said. Your approach really made other persons unconfortable. Resisting changes is part of human nature.
# February 11, 2006 11:02 AM

Eric Wise said:

nHibernate et al pay big dividends when the database structure is in a state of frequent change... I can't say I come across that very often in my projects.

What always makes me slightly nervous about things like nHibernate is that I'm injecting a non .net framework dependency into my project which can make upgrades etc trickier.

Like all things development there is no silver bullet. Part of being a good developer/architect is analyzing the environmental factors present in your project and making appropriate decisions based on those factors, not on your personal preferences.
# February 13, 2006 8:42 AM

Jeremy D. Miller said:

Eric,

An external ORM tool like NHibernate pays big dividends for application structure and testability. We're trying to retrofit a real domain model into our legacy code to replace the existing procedural "transaction script" architecture and I can already see an improvement in coupling and cohesion.

I see a lot of developers crashing and burning because they keep their domain logic too intangled with the persistence. I've had several conversations lately with people that are using internal mapping "Active Record" approaches in .Net and every single one of them is struggling with transactional boundaries and dirty/new/deleted state management that is fairly simple with something like NHibernate.

Keep in mind, when I'm talking about SPROC abuse I'm not talking about basic CRUD operations. I'm talking about business logic, communication outside the SQL box, and even user interface logic within a procedural sproc.
# February 13, 2006 9:31 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Jeremy D. Miller

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 previously worked as a systems architect building mission critical supply chain software for a Fortune 100 company and learned agile development practices as a .Net consultant at ThoughtWorks, one of the pioneers of agile development. Jeremy is the author of the open source StructureMap (http://structuremap.sourceforge.net) tool for Dependency Injection with .Net and the forthcoming StoryTeller (http://storyteller.tigris.org) tool for supercharged FIT testing in .Net. Jeremy's thoughts on just about everything software related can be found on his weblog "The Shade Tree Developer" at http://codebetter.com/blogs/jeremy.miller, part of the popular CodeBetter site. Jeremy is a Microsoft MVP for C#. Check out Devlicio.us!

This Blog

Syndication

News

All opinions expressed here constitute my (Jeremy D. Miller's) personal opinion, and do not necessarily represent the opinion of any other organization or person, including (but not limited to) my fellow employees, my employer, its clients or their agents.

About Me

"Best Of" Compendium

StructureMap (Dependency Injection for .Net)

StoryTeller (Supercharged Fit)

Build your own Cab

TestDriven

MVP