Non-Generic Collections to be Removed from Silverlight [Inbar Gazit]

Non-Generic Collections to be Removed from Silverlight [Inbar Gazit]

Rate This
  • Comments 22

Those of you who are already using Silverlight 1.1 Alpha may have seen that the familiar non-generic collections were all marked as obsolete. This includes almost everything under the System.Collections namespace. You shouldn’t be too surprised. We’ve been telling you for a while that you should not be using these anymore and to instead use the generic collections in the System.Collections.Generic namespace. See the following blog post for more details on how and why to convert your non-generic collections.

While you can technically use obsolete types and only get warnings, we’re completely removing these types from Silverlight so we seriously advise you against using them.

The following types will be completely removed:

  • ArrayList
  • BitArray
  • CaseInsensitiveComparer
  • CaseInsensitiveHashCodeProvider
  • CollectionBase
  • Comparer
  • CompatibleComparer
  • DictionaryBase
  • EmptyReadOnlyDictionaryInternal
  • Hashtable
  • IHashCodeProvider
  • KeyValuePairs
  • ListDictionaryInternal
  • Queue
  • ReadOnlyCollectionBase
  • SortedList
  • Stack

On the other hand we decided to keep most of the non-generic interfaces (including those who were previously marked as obsolete):

  • IEnumerator
  • IEnumerable
  • ICollection
  • IComparer
  • IDictionary
  • IDictionaryEnumerator
  • DictionaryEntry
  • IEqualityComparer
  • IList

The non-generic collection interfaces are required for scenarios where you don’t know the type of T. Consider databinding as an example. Databinding works using non-generic methods today, and can deal with List<T> only because it implements the non-generic IList. There’s no easy way to get an arbitrary T in a non-generic method & manipulate it efficiently. While it may be possible to use Reflection to extract the T and use the type in a very late-bound fashion, this approach incurs a significant performance hit. We must continue to ship our non-generic collection interfaces.

Three other generic types were also removed. Queue<T>, Stack<T> and LinkedList<T> were removed from Silverlight. In this case it wasn’t because they were non-generic but because they are not considered to be part of the core set of types that we deemed essential to be provided with Silverlight. Remember that Silverlight is a very small download and should only include the smallest set of APIs that will allow for useful development. It’s very simple to implement Queue<T> and Stack<T> using List<T> and LinkedList<T> is just a different implementation of List<T> with different performance characteristics and so it’s not an essential part of our core collections group.

Expect to see these changes in a future preview release of Silverlight 1.1. Keep checking out our blog for the announcement about when and where...

  • According to Inbar Gazit almost all of the System.Collection classes (and Queue&lt;T&gt;, Stack&lt;T&gt;

  • Silverlight 1.1の基本クラス ライブラリにおける非ジェネリック系のCollectionについて Alpha版で調査をなされていらっしゃるお客さまも多いのではと思いますが、Silverlightのランタイムにおいて非ジェネリック系のコレクション

  • Alpha版で調査をなされていらっしゃるお客さまも多いのではと思いますが、Silverlightのランタイムにおいて非ジェネリック系のコレクション クラスを取り除く予定でございます。また、ジェネリックのコレクション

  • In Silverlight 1.1 the non-generic collections were marked obsolete. We have announced that the non-generic

  • In Silverlight 1.1 the non-generic collections were marked obsolete. We have announced that the non-generic

  • In Silverlight 1.1 the non-generic collections were marked obsolete. We have announced that the non-generic

  • Luckily the interfaces are still left in. They were marked obsolete, but I had some binding scenarious with my home-made drop-down list box (for the current project) that just didn&#39;t work without IList, as I didn&#39;t know &lt;T&gt; Here&#39;s the

Page 2 of 2 (22 items) 12