Monday, April 12, 2004
My first CodeSmith template
I've been playing with Eric Smith's CodeSmith tool for the past couple of days. The templates that ship with the product are great, although I have had to make some modifications to a couple of them.
I'm in the process of writing my first template to create a simple data access layer. By simple, I mean it's going to create wrapper methods around my CRUD stored procedures (which, BTW, were created using the AllStoredProcedures template that ships with the product).
Based on what I've seen in the other templates, this really shouldn't be difficult. Of course, I could always download a template from the CodeSmith support forums, but I'm really in the mood to try writing a template myself.
I can already see the power of this tool...not necessarily in the templates themselves, but the fact that you could drive the generation from the command line. This means I can specify all the template criteria in a config file and then have the CodeSmith engine kick out the code. This is far better than doing it manually.
The CodeSmith Studio is a nice, well thought-out IDE. I'll post more on the subject later.