11. What is T4? T4 is a vehicle Generates code from described models Models could be Visual Class diagrams ERDs Text-based XSD Database Metadata
12. What is T4? (cont.) A set of tools to build other tools Describe Domain Model User interface Business process Flow Generate code from model Use T4 to generate code
13. T4 - the what What does it stand for? What are the Inputs? What are the outputs? What does the syntax look like? What are the supported languages?
14. Current usages of T4 in VS.NET ASP.NET MVC Views Entity Framework 4 model generation VS Project templates VS Item templates Web forms Class
15. T4 - Syntax A quick overview of T4 syntax Lots of demos
21. template directive parameters debug parameter System %TEMP% folder language parameter Values: C#, VB, C#3.5 inherits parameter Tells which base class to use hostspecific parameter A reference to the object that the hosts the engine. e.g. Host.TemplateFile Host.StandardAssemblyReferences
22. assembly directive <#@ assembly #> Parameter name could be an assembly in the GAC <#@ assembly name=“System.Data” #> or absolute path to the assembly <#@ assembly name=“c:rojectsroj1inebugroj1.dll” #>
36. VS.NET Item template Single file versus multi-file templates As .vsi/.zip VS 2010 /{vs.net folder}/common7/ide/itemtemplates Template parameters are special params When the template wizard runs they are replaced.
39. T4 editors in VS.NET Plug-in by Tangible Engineering * http://visualstudiogallery.msdn.microsoft.com/en-us/60297607-5fd4-4da4-97e1-3715e90c1a23 T4 Editor by Clarius http://www.visualt4.com/downloads.html
40. Slides will be on blog http://joubin.ca CodePlex project http://codekindler.codeplex.com Provides boilerplate classes using T4 Only a few at the moment Thank You!