Appendix D. Generics
Generics[*] are some of the most powerful and useful features of .NET 2.0. Generics allow you to define a type-safe data structure or a utility helper class, without committing to the actual data types used. This results in a significant performance boost and higher-quality code, because you get to reuse data-processing algorithms without duplicating type-specific code. In concept, generics are similar to C++ templates, but they are drastically different in their implementation and capabilities. This appendix discusses the problems that generics address, how they are implemented and applied, and the benefits of the programming model.
[*] This appendix contains excerpts from the white paper “An Introduction to C# Generics,” by Juval Lowy, MSDN Magazine, November 2003, updated January 2005.
Get Programming .NET Components, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.