Creating and Manipulating Collections
The most common collections are provided by the .NET Framework. You can use any of them or create your own collection based on one of them. Each collection is designed for specific purposes. The members included in each Collections class reflect the purpose of the collection.
If you decide to implement your own collection, use the following guidelines:
- Start with the right base class and interfaces. See Selecting a Collection Class for tips on how to choose a collection type.
- Consider making your collection strongly typed. Strongly typed collections provide automatic type validation and avoid processes that adversely affect performance, such as boxing and unboxing and conversions. The System.Collections.Specialized Namespace namespace contains examples of strongly typed collections.
- Consider providing synchronization in your class. See Collections and Synchronization (Thread Safety) for details.
- Consider enabling serialization for your class. See Serialization Concepts for details.
Grouping Data in Collections | System.Collections Namespace | System.Collections.Specialized Namespace | Selecting a Collection Class | Collections and Synchronization (Thread Safety) | Serialization Concepts