SPOIL Yourself

8. March 2006 03:37

There is a recent MSDN article that outlines SPOIL.  It is an acronym for Stored Procedure Object Interface Library. 

I think it is a pretty cool concept that could be potentially very useful in specific situations.  To a certain degree, SPOIL reduces the amount of code required for stored procedure invocation.  Rather than manually creating each parameter, the library will do this for you.  Of course, the same effect can be achieved using the Data Application Block provided by Microsoft.  But, the Application Block is lacking in one particular area where SPOIL really shines...strongly typed stored procedure parameters.  The ability to strongly type stored procedures is very compelling.  There have been numerous instances where a compile time verification of types would have saved me some headaches. 

However, there are a couple of things to keep in mind.  The use of reflection does impose a minor performance penalty that should be considered before jumping in with both feet, particularly in systems and applications that demand an extremely high level of performance.  Even though reflection has dramatically improved in 2.0, there is still a penalty, even if it is miniscule.  In addition, the current implementation relies on the use of read-write properties.  If you require persisting/loading values to read-only and write-only properties or private member variables, you will have to defer to traditional stored procedure invocation or extend the library to suit your needs.

Overall, it is an interesting concept to keep in your programming arsenal for the right occasion.

Comments are closed

About Me

I'm a passionate software developer and advocate of the Microsoft .NET platform.  In my opinion, software development is a craft that necessitates a conscious effort to continually improve your skills rather than falling into the trap of complacency.  I was also awarded as a Microsoft MVP in Connected Systems in 2008, 2009, and 2010.

Can’t code withoutThe best C# & VB.NET refactoring plugin for Visual Studio
Follow jeff_barnes on Twitter

View Jeff Barnes's profile on LinkedIn


Shared Items


Anything you read or see on this site is solely based on my own thoughts.  The material on this site does not necessarily reflect the views of my employer or anyone else.  In other words, I don't speak for anyone other than myself.  So, don't assume I am the official spokesperson for anyone.