I swore a bit in T4 - hey, if it's free and included in VS2008, use it, right?
My main idea was to create a set of templates for reading a database table and create my own roll-your-own ORM classes from it.
I gave up T4, was disappointed and could not get even the simplest things to work, which are a piece of cake in CodeSmith.
Even a simple task, such as choosing which server, database, and table to use, cannot be executed in T4 effectively from outside the template itself. Yes, you can hard-code all of these values ββas string values ββinto a T4 template, but c'mon, this is really not a solution, is it?
CodeSmith has excellent support for choosing a server, database, and tables, and you can set them as properties in the template and just select what you want and let the template do your stuff on that particular table that you have selected.
My conclusion: T4 is promising, but not yet. This may work for very simple scenarios, but right now, in my opinion, has never been more flexible and powerful than Codesmith.
For a script like .netTiers, I will stick with Codesmith for now.
Mark
marc_s
source share