Tuesday, July 6, 2010

Visual Basic Design Patterns: VB 6.0 and VB.NET





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.

Copyright
PREFACE
ACKNOWLEDGMENTS
Part 1: Object-Oriented Programming in VB
Chapter 1. What Are Design Patterns?
Defining Design Patterns
The Learning Process
Studying Design Patterns
Notes on Object-Oriented Approaches
VB Design Patterns
How This Book Is Organized
Chapter 2. UML Diagrams
Inheritance
Interfaces
Composition
Annotation
WithClass UML Diagrams
Visual Basic Project Files
Chapter 3. Using Classes and Objects in VB
A Simple Temperature Conversion Program
Building a Temperature Class
Putting the Decisions into the Temperature Class
Using Classes for Format and Value Conversion
A String Tokenizer Class
Classes as Objects
Class Initialization
Classes and Properties
Another Interface Example—The Voltmeter
A vbFile Class
Programming Style in Visual Basic
Summary
Chapter 4. Object-Oriented Programming
Building VB Objects
Creating Instances of Objects
A VB Measurement Program
Methods Inside Objects
Variables
Passing Arguments by Reference and by Value
Object-Oriented Jargon
Chapter 5. Building Your Own VB Control
A Highlighted Text Field
Testing Your HiText Controls
Adding Properties and Methods to User Controls
Compiling a User Control
Summary
Programs on the CD-ROM
Chapter 6. Inheritance and Interfaces
Interfaces
An Investment Simulator
Writing the Simulator
Indicators for Using an Interface
Reusing Common Methods
Hidden Interfaces
Summary
Programs on the CD-ROM
Chapter 7. Introduction to VB.NET
Syntax Differences in VB.NET
Variable Declarations and Scoping
Compiler Options
Properties in VB6 and VB.NET
Shorthand Equals Syntax
Managed Languages and Garbage Collection
Classes in VB.NET
Building a VB7 Application
The Simplest Window Program in VB.NET
Inheritance
Constructors
Drawing and Graphics in VB.NET
Tooltips and Cursors
Overloading
Inheritance
Namespaces
Public, Private, and Protected
Overriding Methods in Derived Classes
Overloading and Shadowing
Overriding Windows Controls
Interfaces
Summary
Programs on the CD-ROM
Chapter 8. Arrays, Files, and Exceptions in VB.Net
Arrays
Collection Objects
Exceptions
Multiple Exceptions
Throwing Exceptions
File Handling
Exceptions in File Handling
Testing for End of File
The FileInfo Class
A vbFile Class
Programs on the CD-ROM
Part 2: Creational Patterns
Chapter 9. The Simple Factory Pattern
How a Simple Factory Works
Sample Code
The Two Derived Classes
Building the Simple Factory
Writing the Factory Pattern in VB.NET
Factory Patterns in Math Computation
Programs on the CD-ROM
Chapter 10. The Factory Method
The Swimmer Class
The Events Classes
Straight Seeding
Our Seeding Program
Other Factories
The Seeding Program in VB7
When to Use a Factory Method
Programs on the CD-ROM
Chapter 11. The Abstract Factory Pattern
A GardenMaker Factory
How the User Interface Works
Creating an Abstract Factory Using VB7
Adding More Classes
Consequences of Abstract Factory
Programs on the CD-ROM
Chapter 12. The Singleton Pattern
Creating Singleton Using a Static Method
Catching the Error
Providing a Global Point of Access to a Singleton
The MSComm Control as a Singleton
Writing a Singleton in VB.NET
A VB.NET SpoolDemo Program
The Global Point of Access
Other Consequences of the Singleton Pattern
Programs on the CD-ROM
Chapter 13. The Builder Pattern
An Investment Tracker
Calling the Builders
The List Box Builder
The Check Box Builder
Writing a Builder in VB.NET
Using the Items Collection in the ListBox Control
Consequences of the Builder Pattern
Programs on the CD-ROM
Chapter 14. The Prototype Pattern
Cloning in Visual Basic 6
Using the Prototype
Using the Prototype Pattern
Prototype Managers
Writing a Prototype in VB7
Consequences of the Prototype Pattern
Programs on the CD-ROM
Summary of Creational Patterns
Part 3: Structural Patterns
Chapter 15. The Adapter Pattern
Moving Data between Lists
Using the MSFlexGrid
Using a TreeView
Using Adapters in VB7
TreeView Adapters for VB.NET
Adapting a DataGrid
The Class Adapter
Two-Way Adapters
Object versus Class Adapters in VB.NET
Pluggable Adapters
Adapters in VB
Programs on the CD-ROM
Chapter 16. The Bridge Pattern
The visList Classes
The Class Diagram
Extending the Bridge
ActiveX Controls as Bridges
The Bridge Pattern in VB.NET
Changing the Data Side of the Bridge
Consequences of the Bridge Pattern
Programs on the CD-ROM
Chapter 17. The Composite Pattern
An Implementation of a Composite
Computing Salaries
The Employee Classes
The Subords Class
The Boss Class
Building the Employee Tree
Self-Promotion
Doubly Linked Lists
Consequences of the Composite Pattern
A Simple Composite
Composites in VB
The Composite in VB.NET
Other Implementation Issues
Programs on the CD-ROM
Chapter 18. The Decorator Pattern
Decorating a CoolButton
Using a Decorator
Using ActiveX Controls as Decorators
A Decorator in VB.NET
Nonvisual Decorators
Decorators, Adapters, and Composites
Consequences of the Decorator Pattern
Programs on the CD-ROM
Chapter 19. The Façade Pattern
What Is a Database?
Getting Data Out of Databases
Kinds of Databases
ODBC
Microsoft Database Connection Strategies
Database Structure
Building the Façade Classes
Building the Stores and Foods Tables
Building the Price Table
Summary of the Façade Pattern
ADO Database Access in VB6
The ADO DBase Class
Database Access in VB.NET
Using ADO.NET
Adding Rows to Database Tables Using ADO.NET
Making the VB.NET ADO Façade
Creating Classes for Each Table
Storing the Prices
Loading the Database Tables
The Final Application
What Constitutes the Façade?
Consequences of the Façade
Programs on the CD-ROM
Chapter 20. The Flyweight Pattern
Discussion
Example Code
Writing a Flyweight Folder in VB.NET
Flyweight Uses in VB
Sharable Objects
Copy-on-Write Objects
Programs on the CD-ROM
Chapter 21. The Proxy Pattern
Sample Code
Writing a Proxy in VB.Net
Proxies in VB
Copy-on-Write
Comparison with Related Patterns
Programs on the CD-ROM
Summary of Structural Patterns
Part 4: Behavioral Patterns
Chapter 22. Chain of Responsibility
Applicability
Sample Code
The List Boxes
Programming a Help System
A Chain or a Tree?
Chain of Responsibility in VB.NET
Kinds of Requests
Examples in VB
Consequences of the Chain of Responsibility
Programs on the CD-ROM
Chapter 23. The Command Pattern
Motivation
Command Objects
Building Command Objects
Arrays of Commands
Consequences of the Command Pattern
Providing Undo
The Command Pattern in VB.NET
The CommandHolder Interface
Handling Undo Commands in VB.NET
The Command Pattern in the VB Language
Programs on the CD-ROM
Chapter 24. The Interpreter Pattern
Motivation
Applicability
A Simple Report Example
Interpreting the Language
Objects Used in Parsing
Reducing the Parsed Stack
Implementing the Interpreter Pattern
Building an Interpreter in VB6
The Parse Objects
Consequences of the Interpreter Pattern
Programs on the CD-ROM
Chapter 25. The Iterator Pattern
Motivation
Sample VB6 Code
Filtered Iterators
Iterators in VB.NET
Consequences of the Iterator Pattern
Programs on the CD-ROM
Chapter 26. The Mediator Pattern
An Example System
Interactions between Controls
Sample Code
Mediators and Command Objects
The Mediator in VB.Net
Consequences of the Mediator Pattern
Single Interface Mediators
Implementation Issues
Programs on the CD-ROM
Chapter 27. The Memento Pattern
Motivation
Implementation
Sample Code
Command Objects in the User Interface
Handling Mouse and Paint Events
Writing a Memento in VB.NET
Consequences of the Memento
Programs on the CD-ROM
Chapter 28. The Observer Pattern
Watching Colors Change
Writing an Observer in VB.NET
The Message to the Media
Consequences of the Observer Pattern
Programs on the CD-ROM
Chapter 29. The State Pattern
Sample Code
Switching between States
How the Mediator Interacts with the State Manager
Handling the Fill State
Handling the Undo List
A State Pattern in VB.NET
Mediators and the God Class
Consequences of the State Pattern
State Transitions
Programs on the CD-ROM
Chapter 30. The Strategy Pattern
Motivation
Sample Code
The Context
The Program Commands
The Line and Bar Graph Strategies
Drawing Plots in VB
A Strategy Pattern in VB.NET
Consequences of the Strategy Pattern
Programs on the CD-ROM
Chapter 31. The Template Method Pattern
Motivation
Kinds of Methods in a Template Class
Sample Code
The Triangle Drawing Program
Templates and Callbacks
Summary and Consequences
Programs on the CD-ROM
Chapter 32. The Visitor Pattern
Motivation
When to Use the Visitor Pattern
Sample Code
Visiting the Classes
Visiting Several Classes
Bosses Are Employees, Too
Catch-All Operations with Visitors
Double Dispatching
Why Are We Doing This?
Traversing a Series of Classes
Writing a Visitor in VB6
Consequences of the Visitor Pattern
Programs on the CD-ROM
BIBLIOGRAPHY

Download this book click here
Another Visual Basic books click here
Another Programming Language books click here

4 comments:

  1. Here you will find technical articles regarding neural networks, new age programming, design patterns, artificial intelligence, security, microsoft.net related topics etc- among other emerging fields. I've tried to explain the everything in a simple (human readable) way.

    Sample templates

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Great design pattern for visual basic. Great information.

    ReplyDelete

Related Posts with Thumbnails

Put Your Ads Here!