By convention, the names of types that extend certain base types or that implement certain interfaces, or types derived from these types, have a suffix that is associated with the base type or interface.
Naming conventions provide a common look for libraries that target the common language runtime. This reduces the learning curve required for new software libraries, and increases customer confidence that the library was developed by someone with expertise in developing managed code.
The following table lists the base types and interfaces that have associated suffixes.
Types that implement ICollection, and are a generalized type of data structure, such as a dictionary, stack, or queue, are allowed names that provide meaningful information as to the intended usage of the type.
Types that implement ICollection, and are a collection of specific items, have names that end with the word 'Collection'. For example, a collection of Queue objects would have the name 'QueueCollection'. The 'Collection' suffix signifies that the members of the collection can be enumerated using the foreach (For Each in Visual Basic) statement.
Types that implement IDictionary have names that end with the word 'Dictionary' even if the type also implements IEnumerable or ICollection. The 'Collection' and 'Dictionary' suffix naming conventions allow users to distinguish between the following two enumeration patterns.
Types with the 'Collection' suffix follow this enumeration pattern:
foreach(SomeType x in SomeCollection) { } Types with the 'Dictionary' suffix follow this enumeration pattern:
foreach(SomeType x in SomeDictionary.Values) { } A DataSet object consists of a collection of DataTable objects, which consist of collections of System.Data.DataColumn and System.Data.DataRow objects, among others. These collections implement ICollection through the base System.Data.InternalDataCollectionBase class.