CollectionBase vs. ArrayList
Or in Generic realms, Collection<T> vs. List<T>.
What's the big deal between the two of them, we'll see:
|
Comparison |
CollectionBase |
ArrayList |
|
Implemented Interfaces |
ICollection, IEnumerable, IList |
ICollection, IEnumerable, IList |
|
Number of Members |
18; 5 public, 13 protected |
58; all public |
|
Intended Usage |
As a base class for extension |
Ready-to-use |
Extra notes: CollectionBase was widely used pre-Generic for it's strong typing capabilities. ArrayList doesn't have this. But since Generic, List<T> is strong typable, too.
Conclusion: if you're looking for a ready-to-use IList implementation, use ArrayList (or List<T>), and if you're going to extend IList, use CollectionBase.
Anyone up for a speed comparison challenge?