Another day another CodeSmith Composite Power Play

I sling a lot of data in and out of my Jobs Management Application and this afternoon’s slinging consisted of Job Estimate data from Microsoft Access.  The process occurs through a Community Server background task and consists of three steps.  1) Request the List<Business Object>, 2) Retrieve the data to populate it in the AccessDataProvider, and 3) Pass it off to the SqlDataProvider.

I had written CodeSmith templates to perform various aspects of the Access Data Import process, but not what I call a “Composite Template” to handle the entire task.  That was today’s CodeSmith Composite Power Play.

I’m posting this not to discuss the import process, but to provide another demonstration of CodeSmith’s muscle.  Here is the template and the five properties I enter.

I click “Generate” and the result is below.  Click to view actual size.  You’d agree, that’s a lot of code.  And a point I always emphasize, the code compiles the first time and is ready for use with no additional effort, other than entering the query statement. 

The numbers represent the 3 steps of the import process as I mentioned above, 1) request the List<BusinessObject>, 2) retrieve it in the Access Provider, and 3) enter it in the SQL Provider.

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.