CodeSmith vs T4 Level Kit: .netTiers

Has anyone ported the netTiers template to Visual Studio T4 templates? Or is there a system of this scale? Does anyone use T4 in a production environment? What (if any) are the main differences between Codesmith and T4?

+6
t4 codesmith
source share
3 answers

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

+5
source share

T4 is not CodeSmith. Yes, you specify the parameters in the .tt file as C # or Visual Basic code and use the <# @include #> directive to refer to the actual implementation of the code generation logic. This is no harder coding than specifying the same information in an XML file using CodeSmith.

For a T4 template set like NetTiers, check out the S # arp architecture: http://code.google.com/p/sharp-architecture/ .

+5
source share

If you are looking for a T4 implementation of a well-supported DAL, which is Open Source with a Linq interface, as well as Fluent's own interface, which will create wrappers for tables stored by proxies, views, etc. Then you need to try SubSonic 3.0. SubSonic 2.2 has the same Q factor minus the T4 and Linq interface and is in release mode. SubSonic 3.0 is in Alpha, but you can download the code or DLLs and T4 templates if you want.

+1
source share

All Articles