When reading this question I started to wonder a bit. Say you have these two:
class ProductCollection : ICollection<Product>
class ProductList : IList<Product>
What would you call one that were an IEnumerable<Product>?
class Product--- : IEnumerable<Product>
Before I read that other question I might have called it a ProductCollection actually, but taking the new info into account, that would have been a bit misleading since it does not implement ICollection<Product>. Could you call it Products?
var products = new Products(); // products is/are products
Almost works but sounds a bit strange… What would you call it?
You generally do not base the name of a class off any interface it implements. (Which one do you choose when there are multiple ones, for a start?) It is quite typical to base it off an inherited class, but more often simply on the purpose of the class, and certainly not the interface. (The interface might be named after the class, if anything.)
Your example is somewhat invalidated by the fact that a well-designed
ProductCollectionshould implementICollection<Product>andIEnumerable<Product>while a well-designedProductListshould implement both those interfaces as well asIList<Product>.If you look in the BCL of the .NET Framework, you should notice that this is precisely the case. The
List<T>class implements all three interfaces, as does theCollection<T>class (though note that in the general case a ‘collection’ need not implementIList<T>).