Copyright
Brief Table of Contents
Table of Contents
Foreword
Preface
Acknowledgments
About this Book
About the Cover Illustration
1. Demystifying metaprogramming
Chapter 1. Metaprogramming concepts
1.1. Definitions of metaprogramming
1.2. Examples of metaprogramming
1.2.1. Metaprogramming via scripting
1.2.2. Metaprogramming via reflection
1.2.3. Metaprogramming via code generation
1.2.4. Metaprogramming via dynamic objects
1.3. Summary
Chapter 2. Exploring code and metadata with reflection
2.1. The need for reflection
2.1.1. Creating extensible applications
2.1.2. Manipulating code members at runtime
2.2. Reading metadata and executing code
2.2.1. Obtaining the starting point
2.2.2. Finding member information
2.2.3. Gathering attribute data
2.2.4. Executing code
2.3. Impractical uses of reflection
2.3.1. Performance concerns with reflection
2.3.2. Brittleness and reflection
2.4. Practical uses of reflection
2.4.1. Automatically registering known types in WCF
2.4.2. Dynamic implementation of ToString
2.4.3. Invoking arbitrary methods on objects
2.4.4. Quick summary of reflection examples
2.5. Summary
2. Techniques for generating code
Chapter 3. The Text Template Transformation Toolkit (T4)
3.1. Thinking of generics as templates
3.2. Introducing T4
3.2.1. T4 syntax basics
3.2.2. Understanding T4���s block types
3.2.3. How T4 stitches together template blocks
3.2.4. T4���s expression control block