O'Reilly logo

Visual Basic® .NET by Example by Bob Donald, Gabriel Oancea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

NamedObjectCollectionBase—Making Your Own Collections

All the collections you have seen so far can be used as they are—that is, out of the box. This is a good thing, but it has its price: None of these collections are strongly typed, meaning that the methods of the collection use Object base class references in all methods. This means that you can easily make a mistake and pass in the wrong type of object, and the compiler would not be able to tell you that you made a mistake. This is sometimes an acceptable risk, especially if the code that deals with a collection is contained. However, there are cases when you need to expose collections of some of your objects to the outside world. Exposing an ArrayList of Person objects, say, would allow a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required