Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeSmith v.s. T4: .netTiers level suite

Tags:

.net

t4

codesmith

Has someone ported the netTiers template set to Visual Studio's T4 templates? Or is there a system of similar scope? Does anyone use T4 in a work environment? What (if any) major differences are there between Codesmith and T4?

like image 654
kkubasik Avatar asked May 13 '09 01:05

kkubasik


1 Answers

I dabbled in T4 for a bit - hey, if it's free and included in VS2008, use it, right?

My basic idea was to create a set of templates to read a database table, and create our own "roll-your-own" ORM classes from it.

I gave up on T4, frustrated and unable to get even the most basic things to work that are a piece of cake in CodeSmith.

Even a simple task such as selecting what server, database, and table to use cannot be done in T4 efficiently from "outside" the template itself. Yes, you can hard-code all these values as string values into a T4 template - but c'mon, that's really not a solution, is it?

CodeSmith has great support for picking server, database, and tables, and you can set those as properties on the template and just pick what you want and let the template do your stuff on that particular table you picked.

My conclusion: T4 is promising, but "not there" just yet. It might work for very simple scenarios, but right now, it's in my opinion nowhere near as flexible and powerful as Codesmith.

For for a scenario such as .netTiers, I'd stick with Codesmith for the time being.

Marc

like image 89
marc_s Avatar answered Sep 28 '22 17:09

marc_s