Paul Wilson's .NET Blog

Ramblings from the Creator of WilsonDotNet.com

  • Yet Another Post on Dynamic Sql vs. Stored Procs

    I continue to be amazed at the typical discussion of "dynamic sql" vs. stored procs.  The arguments almost always assume that "dynamic sql" equates to hard-coded sql in your application.  This is simply not the case for anyone I know that has ever argued for "dynamic sql".  So first, let's all agree that hard-coded sql in your application is a bad practice.  Now we can move on and really talk about "dynamic sql" vs. stored procs.  Before defining "dynamic sql", lets define stored procs.  That may sound silly and unnecessary -- but seriously -- what are stored procs?  Stored procs are blocks of hard-coded sql in your database!  That's right -- they are hard-coded sql -- just moved to a different physical tier.  Like any other piece of code, these blocks of sql must be written (or generated) and maintained.  The frequently recented argument that stored procs free developers is absurd since it just moves the burden somewhere else!  Its also stated that stored procs allow you to change things without a recompile -- but that's true to a small extent only.  Any serious changes in your data-model are also still going to require changes in your app to know how to work with those changes.  In other words, stored procs are an API, and if you change the API then you're going to have to change your application too!  That said, its certainly true that small optimizations can be made in your stored procs without a recompile, but how often does this really occur?  Most optimizations involve things like proper index tuning, the setup of separate file groups, and other database "tricks" that are not related to sql.  In fact, if the sql in your stored procs is so poor that it can benefit from optimization then you really need to question if you should be writing any sql in the first place!

  • My SourceForge Experience

    SourceForge may be easy for end-users, but its a pain to setup a project for the obscure command-line-challenged.  :)  First, I applied for my project months ago, checked for while and it was never setup, then forgot about it and never got an email that it was done.  Next, CVS is easy with Tortoise, but things don't show up for half a day on the SF site -- that was true both times I added files.  Next, as far as I can tell I don't need any command-line ssh tool, even though it says I do.  Getting my simple html home page setup was still another adventure in command line oddities -- you can't use ftp or any webtool -- you have to use a highly secure (and equally obscure) command line utility.  And as far as I can tell there is no way to delete mistakes -- oops, index.html was the default, not index.htm, but you'd never know without trying since it doesn't tell you this.  Now when you want to actually release something it gets really weird -- first, it has nothing to do with your CVS repository!  Instead you simply use anonymous ftp to upload your files to a common temporary place that everyone else can also see -- so much for security.  :)  It even warns you to make sure you only pick your own files for release, since you can pick anyone else's that are currently there!  And documentation -- it pretty much sucks, not that I can really complain since I don't create much either.  Of course, it really is full-featured, and quick and easy for end-users to download your latest -- which no one in their right mind can say about GotDotNet WorkSpaces.

  • Mostly Finished Huge Project -- Hopefully Posting More

    I hope to find a few minutes to start making some more posts for now on, at least more than last month anyhow.  I've just finished my 4th month being independent and I've just finished (more or less) a huge project.  I like forward to posting lots of things I learned and encountered, so stay tuned.  In the meantime, I wanted to say thanks to everyone that continues to contribute to the WilsonORMapper.  While I take all updates and "mold" them to my liking, its obvious many people have been indispensable.  Allan Ritchie basically contributed to almost everything in v3.0 -- it would not exist without him.  Likewise, Ken Muse served the same role a few months back in helping me with v2.0.  That's not to say that I just take their code, since they probably wonder what I've done when they see it.  :)  But it goes without saying that both their code and our many discussions have been indispensable.  Gerrod Thomas has also been invaluable in tracking down and fixing the tough bugs.  Jerry Shea finds and fixes really esoteric oddities that no one else finds.  :)  And Paul Welter is teaching me about better documentation, exception handling, and now CodeSmith.  Anyhow, while I'm still busy, I do look forward to making more posts about my experiences.  On a personal note, we believe we have sold our house (it hasn't closed yet), and our new one is less than two months away.  Also, the kids have started back to school in 1st grade -- so now I can actually "work" at home!

  • More on UIMappers and WilsonORMapper

    First, I would like to thank Paul Welter for adding XmlComments and an NDoc-generated help file for the WilsonORMapper v2.2.1.0 -- which now supports filter and sortOrder for child relations.  Now, here's a few other thoughts about UI Mappers, especially in comparison with O/R Mappers:

  • Visual Studio 2005 Beta 1 -- Missing in Action

    I've been busy enough that I haven't bothered with the huge downloads yet to get VS 2005 Beta 1 -- afterall I knew I would get it mailed to me soon enough.  Finally this morning the yellow DHL truck arrived with my little package, so I eagerly opened it up.  All I found inside was a piece of paper that said I would find the installation media enclosed, which I did not -- talk about vaporware.  I guess I'll have to find the time to download it now afterall.

  • UI Mappers: A Common Scenario

    The best way to understand what I mean by a UI Mapper is to look at a common scenario -- let's say you have to add a new business entity to your new or existing application.  What do you have to do to support this new entity?  Data, business logic, and UI screens.  If you use an O/R Mapper then you will only need to create your mappings for the data, otherwise you will need to create your sql or stored procs, and hook it all to your DAL.  As for business logic, some people "skip" this and use datasets, but lets get to the UI.