|
Ask anybody who's heard a bit about Visual Basic .NET what the biggest change over
Visual Basic 6 is, and chances are they'll say 'object orientation'. But what does this
mean? Visual Basic has been, to some extent, object-oriented since VB5, so what's so
groundbreaking about the .NET incarnation? Well, most people emphasize inheritance,
stressing that now you can take advantage of the code reuse and polymorphism of
class hierarchies. That is indeed one of the most visible ways that object orientation can
be used in our code, but there's a crucial, fundamental shift that VB.NET programmers
have to get used to, which is not so Widely emphasized: in VB.NET, all the code we
ever write ends up belonging to a class.
So, every time you sit down and fire up Visual Studio .NET, or notepad, and begin to
write VB.NET code, what you are actually doing is designing a class. When you code a
Sub you're writing a method; when you declared an Event you're creating fields,
methods, and other classes. Understanding this, learning what we can put into a class,
and what it all really means to the .NET runtime, is fundamental to being able to take
full advantage of Visual Basic . NET. Explaining how to use the language to get the
most out of the .NET platform is the goal of this series; explaining how to use it to get
the most out of .NET's type system is the goal of this book. |