Coding New Types
One of the most important new features in the Visual Studio 2010 IDE is the ability to generate on-the-fly objects that do not exist yet. This feature is known as Generate From Usage. To understand how it works, simply create a new Console application named
GenerateFromUsage and within the
Main method type the following code:
Person class has not been implemented, the Visual Basic compiler throws an exception, offering the usual pop-up button that suggests solutions. But with Visual Basic 2010 things change; now you have additional solutions, as shown in Figure 18.1.