Visual Basic .NET Class Design Handbook

What does this book cover?

The basic unit of code in .NET is the class. The most important skills Visual Basic .NET programmers need to develop are those required to develop effective, usable classes.

This book aims to act as a practical guide to the issues and choices that face a VB.NET programmer each time they sit down to code a class. Which methods and properties should be public, when should class members be used, what constructors should you provide, when and how should you override methods in the System.Object class, when should a method throw an exception, when should you fire events, and so on.

All of these questions are encountered every day by VB.NET programmers. All of them need to be informed by an understanding of the way classes operate within the .NET runtime, and the way other code interacts with the classes you write.

What will you learn?

  • The role of types in .NET.
  • The different kinds of types we can create in VB.NET.
  • The fundamental role of methods as containers of program logic.
  • Effective uses for constructors.
  • Object cleanup and disposal.
  • When and how to use properties and indexers to encapsulate data.
  • How .NET's events system works.
  • How to control and exploit inheritance in our types.

Who is this book for?

This is not a dry, theoretical text, and it is not about UML object modelling. It seeks to provide practical solutions to everyday issues, and is illustrated with plenty of code examples and counter-examples. The objective is to help you, a VB.NET developer, build a set of instincts that will help you produce better, cleaner, more reusable, more robust classes first time, and avoid having to revisit, refactor or redesign classes later on.