2020ok  Directory of FREE Online Books and FREE eBooks

Free eBooks > Computers & Internet > Programming > Introductory & Beginning > General > Visual Basic Design Patterns VB 6 0 and VB NET fly

Visual Basic Design Patterns VB 6 0 and VB NET fly

by James W. Cooper

Download Book

If you are the author or the publisher, and would like to link to your site here, please contact us.

About Book

Suitable for Visual Basic developers of all levels, Visual Basic Design Patterns brings the powerful concept of reusable software patterns to the world's most popular programming language. While C++, Java, and Smalltalk programmers have long had recourse to hundreds of reusable object-oriented designs, this fascinating and very approachable text puts these powerful design concepts into reach for working VB programmers.

One of the most important (and popular) computer titles in recent memory, Design Patterns: Elements of Reusable Object-Oriented Software, brought patterns to C++ and Smalltalk programmers in 1995. The goal of Visual Basic Design Patterns is to translate the 23 designs (or patterns) outlined in that influential text into a VB setting.

First, Cooper establishes the object-oriented features in Visual Basic 6 and its support for classes and objects. Then it's on to Unified Modeling Language (UML) class diagrams for documenting the "shape" of each pattern. Next comes a tour of the new-and-improved object support in Visual Basic .NET. With the arrival of .NET in 2002, VB became a full-fledged object-oriented language. (Included here is an overview of .NET features and APIs needed to work with basic data types, collections, and files.)

The author largely succeeds in making patterns approachable. Using creational patterns like factories and builders, you'll learn how to create objects more flexibly. Structural patterns, like the adapter and composite patterns, show off how classes can relate to one another beyond simple inheritance. Behavioral patterns like the chain of responsibility and interpreter patterns show off how to add more functionality to your VB projects. Illustrated with clear examples, many using built-in features of VB such as controls or other existing classes, Cooper shows that patterns are readily available for most any developer. Several examples make use of employee classes for modeling an organization, and this allows the author to connect some of the material between sections. For each pattern, you'll get VB 6 and VB .NET versions of code (though, of course, VB .NET makes it easier to model classes with inheritance where required).

This timely volume arrives just as VB .NET brings Visual Basic to the first rank of object-oriented languages with "true" inheritance and other advanced class design features. Surprisingly enough, inheritance is just the tip of the iceberg when it comes to getting objects to work together. While C++ and Java programmers have made use of the library of patterns presented here to do more with classes, VB programmers can now benefit from the same expertise in a format that is definitely a lot more approachable than the original. If history is any cue, Visual Basic Design Patterns should become as indispensable to VB developers as the original software patterns book was to an earlier generation of developers in other languages. --Richard Dragan

Topics covered: Introduction to software design patterns; basic UML diagrams (including inheritance and composition); classes and objects in Visual Basic and VB .NET; object-oriented programming basics; building custom VB user-interface controls; inheritance and interfaces; VB .NET quick start (data types and basic programming tutorial with simple objects); VB .NET APIs for arrays, collections, and file I/O; creational patterns: simple factories, abstract factories, singletons, builder, and prototype patterns; structural patterns: adapters (used with data grids), the bridge pattern, the composite pattern (an employee class hierarchy), the decorator pattern (with ActiveX controls), the façade pattern (used with databases), the flyweight and proxy patterns; behavioral patterns: chain of responsibility (used with a help system), the command pattern (implementing "undo"), the interpreter pattern (for a report language), the iterator pattern (and VB .NET collections), the mediator pattern (used with UI controls), the memento, observer, and state patterns, the strategy pattern (used with graphical plots), the template pattern, and the visitor pattern (used with employee classes).

Book Description

Design patterns provide elegant, reusable solutions to commonly recurring problems in software design. They're invaluable -- but until now, they've been off-limits to most VB developers, because most design patterns have focused on either C++ or Java. In Visual Basic Design Patterns, James W. Cooper provides the definitive guide to design patterns for both Visual Basic 6 and Microsoft's new VB.NET. Using Cooper's patterns, VB developers can build software that is more robust, more scalable, and delivers far better performance in even the most challenging enterprise environments. Cooper begins with a gentle introduction to the idea and goals of patterns, showing how they can be used to improve both VB6 and VB.NET software. He organizes the book's patterns into three categories: Creational, Structural and Behavioral. For each pattern, the book offers a brief description followed by simple example programs in both VB6 and VB.NET, supported by both screen shots and simple UML diagrams. All code for both VB6 and VB.NET is provided on the accompanying CD-ROM.

Book Info
Written from a Visual Basic perspective, this guide intends to make you comfortable with using design patterns by laying out the concept of patterns in a practical fashion. Provides one or more complete working visual examples of programs using that pattern, along with UML diagrams illustrating how the classes interact. Softcover. CD-ROM included.

From the Back Cover

Design patterns provide programmers with a convenient way to reuse object-oriented code across projects and between programmers, offering easy, time-saving solutions to commonly recurring problems in software design. A practical guide to writing Visual Basic (VB6 and VB.NET) programs using some of the most common design patterns, Visual Basic Design Patterns is a tutorial for people who want to learn about design patterns and how to use them in their work. This book also provides a convenient way for VB6 programmers to migrate to VB.NET and use its more powerful object-oriented features.

Written from a Visual Basic perspective, this book intends to make you comfortable with using design patterns by laying out the concept of patterns in a practical fashion. Organized as a series of short chapters that each describe a design pattern, Visual Basic Design Patterns provides one or more complete working visual examples of programs using that pattern, along with UML diagrams illustrating how the classes interact. Each example is a visual program that you can run and study on the companion CD making the pattern as concrete as possible. Programmers using this book will see significant improvement in their work by employing the following key concepts:

  • Applying "tried-and-true" object-oriented design patterns in Visual Basic applications.
  • Helping advance programming skills with the power of patterns.
  • Understanding the interactions between classes through the use of UML diagrams.
  • Getting comfortable using design patterns effectively and start using them in day-to-day Visual Basic programming.

The idea behind design patterns is simple: it's a catalogue of common interactions between objects that programmers have found useful, enabling them to quickly and easily employ them in their programs. Visual Basic Design Patterns provides practical advice on how to use these patterns in everyday programming.


About the Author

James W. Cooper is a research staff member in the Advanced Information Retrieval and Analysis Department at the IBM Thomas J. Watson Research Center. He is also a columnist for Java Pro magazine and a reviewer for Visual Basic Programmer's Journal. He has published 14 books, which include Principles of Object-Oriented Programming Using Java 1.1 (Ventana) and The Visual Basic Programmer's Guide to Java (Ventana).


Excerpt. © Reprinted by permission. All rights reserved.

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 secondchapter.

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. Cooper
Nantucket, MA
Wilton, CT
Maui, HI
October, 2001




PLEASE READ: All comments must be approved before appearing in the thread; time and space constraints prevent all comments from appearing. We will only approve comments that are directly related to the article, use appropriate language and are not attacking the comments of others.

Message (please, no HTML tags. Web addresses will be hyperlinked):

Related Free eBooks

Related Tags

DIGG This story   Save To Google   Save To Windows Live   Save To Del.icio.us   diigo it   Save To blinklist
Save To Furl   Save To Yahoo! My Web 2.0   Save To Blogmarks   Save To Shadows   Save To stumbleupon   Save To Reddit