467,878 Members | 1,264 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,878 developers. It's quick & easy.

StringDictionary does not implement either ICollection or IDictionary?

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
Nov 15 '05 #1
  • viewed: 3309
Share:
4 Replies
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 [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sanjay Vyas" <sanjayvyas@_hotmail.com> wrote in message
news:uh**************@TK2MSFTNGP12.phx.gbl...
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

Nov 15 '05 #2
Nicholas Paldino [.NET/C# MVP] <mv*@spam.guard.caspershouse.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #3
Very true.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Nicholas Paldino [.NET/C# MVP] <mv*@spam.guard.caspershouse.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #4
It must be a bug as an article on MSDN actually
mentions"....StringDictionary (based on IDictionary)...."
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Nicholas Paldino [.NET/C# MVP] <mv*@spam.guard.caspershouse.com> wrote:
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.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by J.R | last post: by
2 posts views Thread by Wamiq Ansari | last post: by
reply views Thread by Simon Dahlbacka | last post: by
reply views Thread by Hans | last post: by
5 posts views Thread by Tony Johansson | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.