PREFACE

This is a practical book that tells you how to write Visual Basic (VB6 and VB.NET) programs using some of the most common design patterns. It also serves as a quick introduction to programming in the new VB.NET version of the VB language. The pattern discussions are structured as a series of short chapters, each describing a design pattern and giving one or more complete working, visual-example programs that use that pattern. Each chapter also includes UML diagrams illustrating how the classes interact.

This book is not a “companion” book to the well-known Design Patterns text by the “Gang of Four.” Instead, it is a tutorial for people who want to learn what design patterns are about and how to use them in their work. You do not have to have read Design Patterns to read this book, but when you are done here you may well want to read or reread it to gain additional insights.

In this book you will learn that design patterns are frequently used ways of organizing objects in your programs to make them easier to write and modify. You'll also see that by familiarizing yourself with them, you've gained some valuable vocabulary for discussing how your programs are constructed.

People come to appreciate design patterns in different ways—from the highly theoretical to the intensely practical—and when they finally see the great power of these patterns, an Aha! moment occurs. Usually this moment means that you suddenly have an internal picture of how that pattern can help you in your work.

In this book, we try to help you form that conceptual idea, or gestalt, by describing the pattern in as many ways as possible. The book is organized into six main sections: an introductory description, an introduction to VB.NET, and descriptions of patterns, grouped as creational, structural, and behavioral.

For each pattern, we start with a brief verbal description and then build simple example programs. Each of these examples is a visual program that you can run and examine to make the pattern as concrete a concept as possible. All of the example programs and their variations are on the companion CD-ROM, where you run them, change them, and see how the variations you create work.

We show that you can use design patterns effectively in VB6 and then show the same patterns in VB.NET (also called VB7). Since each of the examples consists of a number of VB files for each of the classes we use in that example, we also provide a VB project file for each example and place each example in a separate subdirectory to prevent any confusion. We place the VB.NET examples in a separate directory under each pattern. This book is based on the Beta-2 release of VB.Net. Any changes between this version and the final product will probably not be great. Consult the Addison-Wesley Web site for updates to any example code.

If you leaf through the book you'll see screen shots of the programs we developed to illustrate the design patterns, providing yet another way to reinforce your learning of these patterns. In addition, you'll see UML diagrams of these programs, illustrating the interactions between classes in yet another way. UML diagrams are just simple box-and-arrow illustrations of classes and their inheritance structure, where arrows point to parent classes, and dotted arrows point to interfaces. And if you're not yet familiar with UML, we provide a simple introduction in the second chapter.

When you finish this book you'll be comfortable with the basics of design patterns and will be able to start using them in your day-to-day Visual Basic programming work.

James W. CooperNantucket, MAWilton, CTMaui, HIOctober, 2001

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset