|This tutorial—BCL Generics—is from Professional .NET 2.0 Generics, by Tod Golding. Copyright © 2005 Wiley Publishing, Inc. All rights reserved. This article is reproduced by permission. This tutorial has been edited especially for C# Online.NET. Read the book review!|
(As this is C# resource site, VB examples have been omitted.)
The potential and power of generics is most fully realized in the implementation of container frameworks. Given this reality, it only made sense that the introduction of generics would also be accompanied by the introduction of a pool of new generic types. In version 2.0 of the .NET Framework, the Base Class Library (BCL) introduces two new namespaces,
System.Collections.ObjectModel, both of which include generic representations of many of the non-generic containers that already existed in the
System.Collections namespace long before generics came along. The goal of this chapter is to provide you with an overview of the classes that appear in these namespaces, along with a roadmap for how and when you might want to apply each of these generic types. It also covers all the key methods and properties that are associated with each of these new types.