Custom Collections
Like Java, .NET makes it difficult to subclass concrete collection classes to provide specialized behavior without implementing large amounts of functionality. There always seems to be some vital method or inner class that is not accessible. Both languages provide abstract classes as the mechanism for custom designs, but we think that the .NET classes are better thought out.
The abstract classes in .NET are listed in Table 9-7.
Table 9-7. Abstract .NET Collection Classes
Class | Description |
|---|---|
CollectionBase | Provides a basis for strongly typed collections. |
ReadOnlyCollectionBase | Provides a basis for strongly typed collections that don’t permit elements to be modified. |
DictionaryBase | Provides a basis for strongly typed collections of key/value ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access