Wednesday, April 21, 2004

CodeSmith and my DAL

My original thought was to write a template for CodeSmith that would generate wrapper methods around all my stored procedures.  I've been rethinking this approach, although I'm not sure exactly what I'm going to do.

Anyway...I've been working on the CodeSmith template and I have a good start.  For each stored procedure in my database, I'm creating a method within a class named 'StoredProcedures'.  This class lives in my DataAccess namespace.  I have my 'insert' wrappers returning an integer value (my insert stored procs return @@identity).  My "select" wrappers return DataTables.  Updates and Deletes return void.  I'll probably include exception handlers in all of the methods.

The cool thing about CodeSmith is that you can write methods that are callable from within the template.  For example, I have a method that returns the "return type" for my method based on the type of stored procedure that's being called.  I've got another method that returns my C# parameter list based on the parameters the stored procedure requires.

The biggest complaint I have so far with CodeSmith (I'm using the trial version of CodeSmith Studio) is the amount of time it takes to compile/generate the output.  Of course, the system I'm using to test CodeSmith (and to write this blog) is an old P-II 400.  My laptop (a P-III 1.7 gHz) is sitting on my desk, but that would mean leaning forward to type. :-)

I'm also tempted to change the template so that it doesn't automatically process every stored procedure in the database.  I may change it so a single proc is processed.  If I want to process them all, I'll create a config file and run CodeSmith from the command-line.


Comments:
Bend to Our Stygian Prices at www.Pharmashack.com, The Firstly [b][url=http://www.pharmashack.com]Online Lozenge cylinder's [/url][/b] To [url=http://www.pharmashack.com]Buy Viagra[/url] Online ! You Can also Learn up Eminent Deals When You [url=http://www.pharmashack.com/en/item/cialis.html]Buy Cialis[/url] and When You You [url=http://www.pharmashack.com/en/item/levitra.html]Buy Levitra[/url] Online. We Also Be struck on a Ginormous Generic [url=http://www.pharmashack.com/en/item/phentermine.html]Phentermine[/url] As a services to Your Nutriment ! We Imbroglio up Aeroplane consequence brand [url=http://www.pharmashack.com/en/item/viagra.html]Viagra[/url] and Also [url=http://www.pharmashack.com/en/item/generic_viagra.html]Generic Viagra[/url] !
 
Get abide the organism with two backs casinos? discipline this environmental [url=http://www.realcazinoz.com]casino[/url] steersman and steppe online casino games like slots, blackjack, roulette, baccarat and more at www.realcazinoz.com .
you can also discontinuation our lately [url=http://freecasinogames2010.webs.com]casino[/url] box loath of at http://freecasinogames2010.webs.com and be the champion in de jure in clover !
another voguish [url=http://www.ttittancasino.com]casino spiele[/url] in the sector of is www.ttittancasino.com , because german gamblers, bloomer in unconstrained online casino bonus.
 
I read this forum since 2 weeks and now i have decided to register to share with you my ideas. [url=http://inglourious-seo.com]:)[/url]
 
You could easily be making money online in the undercover world of [URL=http://www.www.blackhatmoneymaker.com]blackhat team[/URL], You are far from alone if you haven’t heard of it before. Blackhat marketing uses little-known or little-understood ways to build an income online.
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?