ASP.NET 2.0: Generic Collections
By: Joel Martinez on Tuesday, July 19, 2005
Reader Level: 
One of the biggest problems that .NET 1.1 had was that its collections, for the sake of versatility, only dealt with the object data type. This way, you could store any data in there, from int to string, and the class would behave the same. Unfortunately, this created several issues ... from a usage perspective, it was unwieldy because you always had to cast the object back into usable form when you accessed it. And in some situations, this casting would cause performance issues, particularly when relating to value types.
With Generic collections, all of those problems go away because generics allow you to create customized "versions" of your generic template classes. So if you want your class to be able to interact with an int as easily as it interacts with a string, you can easily create a generic class with a placeholder type.
This article will cover the new Generic collection features in C# 2.0 which will help reduce your development time and increase your application's performance.
Purchase this item
You can purchase this piece of content separately for
$3.00
Want more?
Community MX members get unlimited access to daily articles,
tutorials, extensions and support. The most comprehensive
resource for Macromedia designers and developers today.
Take a tour of what we offer, and discover the benefits
of subscribing.
Already a member?
Simply log in using the form in the top right area of the site.



