Dave Burke : Freelance .NET Web Developer specializing in Online Communities

CodeSmith Today. 02.22.2006

This isn't a newsy bit on CodeSmith, though there is a pretty new 3.2.5 version of CodeSmith available if you're still using 3.2.4 or earlier.  This post is more an example to serve as a nudgie for .NET developers who may not think in terms of Code Generation in everyday development.  I used this template a couple of days ago.  It's a Data Layer oldie but goodie I wrote probably about two years ago to generate data update and entry methods for both a primary and secondary SQL table.

I don't want to get sidetracked in the details of the CodeSmith Template (located here) or the generated code.  The point is that I was able to create a Data Layer Class that entered data into four different SQL tables in a matter of minutes using CodeSmith.  I passed a business object (also created in CodeSmith in a couple of minutes) to each method and had to edit some of the properties of that object generated from CodeSmith, but with full intellisense that was a snap.

Below is the Data Layer Class, minimized to demonstrate the amount of code generated.  An individual method is shown in the pull-out. To be able to knock out a utility class like this in such a short amount of time is a tribute to the power of CodeSmith and thinking in terms of Code Generation in everyday development. 






The result of course is more quality dog walking time.  A guy's gotta have priorities.

 


Technorati Tags:

Comments (0) | Post RSS RSS comment feed

Posted on 2/22/2006 7:24:00 PM by Dave Burke
Categories: .NET | CodeSmith

Related posts

Comments are closed

Copyright © 2008 Dave Burke Consulting  |  All Rights reserved.