Chapter 3. The Text Template Transformation Toolkit (T4)

 

In this chapter

  • Thinking of generics as templates
  • Introducing T4 and exploring useful T4 examples
  • Using T4 inside Visual Studio

Pattern recognition and the beneficial repetition of proven patterns are considered to be excellent qualities in a software developer. Software developers and architects who have great pattern vocabularies are often the best among us. These are the developers who rarely try to reinvent complex solutions from scratch. Instead, they rely on well-known best practices, borrowing from the demonstrated success of others to produce their own great works. Code generation, which is viewed by many as a form of metaprogramming, is typically a key part of their successful development methodology. This chapter focuses on template-based metaprogramming using Microsoft’s Text Template Transformation Toolkit (T4) to learn how these master developers think and work.

3.1. Thinking of generics as templates

3.2. Introducing T4

3.3. More useful T4 examples

3.4. T4 fundamentals

3.5. Using T4 inside Visual Studio

3.6. Summary

sitemap