O'Reilly logo

Professional Visual Basic 2012 and .NET 4.5 Programming by Todd Herman, Gastón Hillar, David McCarter, Rob Windsor, Billy Hollis, Bill Sheldon

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

Summary

This chapter took a look at the classes and language elements that target sets. You started with a look at arrays and the support for arrays within Visual Basic. The chapter then looked at collection classes. By default, these classes operate on the type Object, and it is this capability to handle any or all objects within their implementation that makes these classes both powerful and limited.

Following a quick review of the iterative language structures normally associated with these classes, the chapter moved on to looking at generics. Generics enable you to create class, structure, interface, and method templates. These templates gain specific types based on how they are declared or called at runtime. Generics provide you with another code reuse mechanism, along with procedural and object-oriented concepts.

Generics also enable you to change code that uses parameters or variables of type Object (or other general types) to use specific data types. This often leads to much better performance and increases the readability of your code.

Next you'll move into working with XML from Visual Basic. XML processing and generation are one of Visual Basic's strengths. As you'll see, while you may have an XML file with only a single entry, by its nature XML lends itself to creating collections of objects.

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