Ray's playground

 

Collections(Chapter 7 of C# 4.0 in a nutshell)

  Although the enumeration interfaces provide a protocol for forward-only iteration over a collection, they don’t provide a mechanism to determine the size of the collection, access a member by index, search, or modify the collection. For such functionality, the .NET Framework defines the ICollection, IList, and IDictionary interfaces. Each comes in both generic and nongeneric versions; however, the nongeneric versions exist mostly for legacy.

 

  IEnumerable<T> (and IEnumerable)

  Provides minimum functionality (enumeration only)

 

  ICollection<T> (and ICollection)

  Provides medium functionality (e.g., the Count property)

 

  IList <T>/IDictionary <K,V> and their nongeneric versions

  Provide maximum functionality (including “random” access by index/key)

 

posted on 2010-06-22 12:20  Ray Z  阅读(156)  评论(0编辑  收藏  举报

导航