Text Template Transformation Toolkit

Microsoft's Text Template Transformation Toolkit (usually referred to as "T4") is a template based text generation framework included with Visual Studio. T4 source files are usually denoted by the file extension ".tt".

T4 is used by developers as part of an application or tool framework to automate the creation of text files with a variety of parameters. These text files can ultimately be any text format, such as code (for example C#), XML, HTML or XAML.

T4 uses a custom template format which can contain .NET code and string literals in it, this is parsed by the T4 command line tool into .NET code, compiled and executed. The output of the executed code is the text file generated by the template.[1] T4 can also be completely run within the .NET applications via the use of the TextTransformation class which eliminates the need for the end user to have Visual Studio installed.

T4 is used within Microsoft in ASP.NET MVC for the creation of the views and controllers, ADO.NET Entity Framework for entity generation, and ASP.NET Dynamic Data.[2] It is also used outside of Microsoft in projects such as SubSonic[3]

T4 templating is also supported in MonoDevelop.

Criticism

Microsoft has often been criticized for the lack of tooling support for T4 within the Visual Studio IDE, and relies on third parties namely Tangible Engineering and Clarius Consulting,[4] however later revisions have included better tooling support.[5]

History

See also

References

  1. Web Templates (2013), Website templates, Website Templates South Africa, ISBN 978-1-4251-3374-0, retrieved 19 November 2013
  2. "Fun with T4 templates and Dynamic Data - Angle Bracket Percent - Site Home - MSDN Blogs". Blogs.msdn.com. 2008-11-26. Retrieved 2012-05-17.
  3. "SubSonic v3's T4 Templates « Daily Cycle". Gcapnias.wordpress.com. 2009-01-12. Retrieved 2012-05-17.
  4. Sych, Oleg (2007-12-22). "T4: Text Template Transformation Toolkit". Oleg Sych. Retrieved 2012-05-17.
  5. 1 2 "What's new in T4 in Visual Studio 2010 - [Profoundly Esoteric Image] - Site Home - MSDN Blogs". Blogs.msdn.com. 2010-04-15. Retrieved 2012-05-17.
This article is issued from Wikipedia - version of the 9/19/2015. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.