10.7. Summary

This chapter began by examining the issues associated with the classic containers found within the System.Collections namespace. While these types remain supported for purposes of backward compatibility, new .NET applications will benefit from using the generic counterparts within the System.Collections.Generic namespace instead.

As you have seen, a generic item allows you to specify placeholders (type parameters) that you specify at the time of object creation (or invocation, in the case of generic methods). Essentially, generics provide a solution to the boxing and type-safety issues that plagued .NET 1.1 software development. Also, generic types largely remove the need to build custom collection types.

While you will most often ...

Get Pro C# 2010 and the .NET 4 Platform, Fifth 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.