StringDictionary does not implement either ICollection or IDictionary?

  • Thread starter Thread starter Sanjay Vyas
  • Start date Start date
S

Sanjay Vyas

Sorry, forgot to cross post this one..

This is rather unusual as we would expect any Collection class to implement
ICollection interface and furthermore a Dictionary class should implement
IDictionary interface. The StringDictionary class does implements all the
methods of ICollection and IDictionary yet it does not list these
interfaces. Am I missing something here or was it an oversight on the part
of the class developer. Maybe I have attained the .NET nirvana yet?

Sanjay Vyas
 
Sanjay,

This is rather odd. It should implement IDictionary, at least (I don't
think it should implement ICollection, because nothing is really indexed by
number here, and you can't guarantee the order). I'll submit it as a bug,
but the new generic classes should rectify this (as the generic will
implement the appropriate interfaces).

Hope this helps.
 
Nicholas Paldino said:
This is rather odd. It should implement IDictionary, at least (I don't
think it should implement ICollection, because nothing is really indexed by
number here, and you can't guarantee the order).

I think you're getting confused with IList (like I did this morning).
IDictionary itself actually implements/extends ICollection - any
IDictionary is also an ICollection.
 
It must be a bug as an article on MSDN actually
mentions"....StringDictionary (based on IDictionary)...."
 
Back
Top