Simply put, Microsoft defined a ReadOnlyCollectionBase, yet did not use it as the base class for ReadOnlyCollection<T> when it clearly sounds that this should have been the way.
Am I missing something here? I mean, was there a good reason to NOT make this class the base class?
Probably because it’s not generic and implements
ICollectionwhereasReadOnlyCollection<T>is generic and implementsICollection<T>. Note thatICollection<T>does not implementICollection. On that topic:From that same post:
Effectively,
ReadOnlyCollection<T>isReadOnlyCollectionBasein the generics space.Note, similarly, that
IList<T>does not implementIList.In general, pre-generics classes do not serve as useful abstractions for generic classes (with the exception of
IEnumerable).