Visual Basic Design Patterns VB 6.0 and VB.NET
James W. Cooper
- 出版商: Addison Wesley
- 出版日期: 2001-12-15
- 售價: $1,840
- 貴賓價: 9.5 折 $1,748
- 語言: 英文
- 頁數: 256
- 裝訂: Paperback
- ISBN: 0201702657
- ISBN-13: 9780201702651
-
相關分類:
.NET、Visual Basic、Design Pattern
已絕版
買這商品的人也買了...
-
$680$537 -
$2,340$2,223 -
$1,000$950 -
$1,320Enterprise JavaBeans Component Architecture: Designing and Coding Enterprise App
-
$420$332 -
$2,010$1,910 -
$690$587 -
$450$383 -
$590$466 -
$1,680Software Architecture in Practice, 2/e (Hardcover)
-
$720$569 -
$290$261 -
$640$576 -
$149$149 -
$750$675 -
$560$504 -
$931Mobile Commerce and Wireless Computing Systems
-
$780$616 -
$490$382 -
$1,890$1,796 -
$820$738 -
$480$408 -
$580$458 -
$450$351 -
$480$470
相關主題
商品描述
This is a practical tutorial to writing Visual Basic (VB6 and VB.NET) programs using some of the most common design patterns. This book also provides a convenient way for VB6 programmers to migrate to VB.NET and use its more powerful object-oriented features. 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 students can run and study on the companion CD making the pattern as concrete as possible.
Table of Contents
Preface.
Acknowledgements.
I. OBJECT-ORIENTED PROGRAMMING IN VB.
1. What Are Design Patterns?
The Learning Process.
Studying Design Patterns.
Notes on Object Oriented Approaches.
VB Design Patterns.
How this Book is Organized.
2. UML Diagrams.
Interfaces.
Composition.
Annotation.
WithClass UML Diagrams.
Visual Basic Project Files.
3. Using Classes and Objects in VB.
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.
4. Object-Oriented Programming.
Creating Instances of Objects.
A VB Measurement Program.
Methods Inside Objects.
Variables.
Passing Arguments by Reference and by Value.
Object Oriented Jargon.
5. Building Your Own VB Control.
Testing Your HiText Controls.
Adding Properties and Methods to User Controls.
Compiling a User Control.
Summary.
Program on the CD-ROM.
6. Inheritance and Interfaces.
An Investment Simulator.
Writing the Simulator.
Indicators for Using an Interface.
Reusing Common Methods.
Hidden Interfaces.
Summary.
Programs on the CD-ROM.
7. Introduction to 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.
8. Arrays, Files and Exceptions in VB.Net.
Collection Objects.
Hashtables.
SortedLists.
Exceptions.
Multiple Exceptions.
Throwing Exceptions.
File Handling.
Reading a Text File.
Writing a Text File.
Exceptions in File Handling.
Testing for End of File.
The FileInfo Class.
A vbFile Class.
Programs on the CD-ROM.
II. CREATIONAL PATTERNS.
9. The Simple Factory Pattern.
Sample Code.
The Two Derived Classe.
Building the Simple Factory.
Writing the Factory Pattern in VB.NET.
Factory Patterns in Math Computation.
Programs on the CD-ROM.
10. The Factory Method.
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.
11. The Abstract Factory Pattern.
How the User Interface Works.
Creating an Abstract Factory Using VB7.
Handling the RadioButton and Button Events.
Adding More Classes.
Consequences of Abstract Factory.
Programs on the CD-ROM.
12. The Singleton Pattern.
Catching the Error.
Providing a Global Point of Access to a Singleton.
The MSComm Control as a Singleton.
Writing a Singleton in VB.NET.
Error Handling in Our Singleton.
A VB.NET SpoolDemo Program.
The Global Point of Access.
Other Consequences of the Singleton Pattern.
Programs on Your CD-ROM.
13. The Builder Pattern.
Calling the Builders.
The List Box Builder.
The Checkbox Builder.
Writing a Builder in VB.NET.
The CheckChoice Class.
The ListboxChoice Class.
Using the Items Collection in the ListBox Control.
Consequences of the Builder Pattern.
Programs on the CD-ROM.
14. The Prototype Pattern.
Using the Prototype.
Using the Prototype Pattern.
Dissimilar Classes with the Same Interface.
Prototype Managers.
Writing a Prototype in VB7.
Consequences of the Prototype Pattern.
Programs on the CD-ROM.
Summary of Creational Patterns.
III. Structural Patterns.
15. The Adapter Pattern.
Using the MSFlexGrid.
Using a TreeView.
Two Way Adapters.
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.
16. The Bridge Pattern.
The Class Diagram.
Extending the Bridge.
ActiveX Controls as Bridges.
The Bridge Pattern in VB.NET.
The Grid VisList Class.
Loading the Data.
Changing the Data Side of the Bridge.
Consequences of the Bridge Pattern.
Programs on your CD-ROM.
17. The Composite Pattern.
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.
Multiple Boss Constructors.
Other Implementation Issues.
Programs on the CD-ROM.
18. The Decorator Pattern.
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.
19. The Facade Pattern.
Getting Data out of Databases.
Kinds of Databases.
ODBC.
Microsoft Database Connection Strategies.
Database Structure.
Building the Facade Classes.
Building the Stores and Foods Tables.
Building the Price Table.
Summary of the Facade Pattern.
ADO Database Access in VB6.
Adding and Seeking Rows Table Rows.
Using the ADO Extensions.
The ADO Dbase Class.
Database Access in VB.NET.
Using ADO.NET.
Reading Data from a Database Table.
Executing a Query.
Deleting the Contents of a Table.
Adding Rows to Database Tables Using ADO.NET.
Making the VB.NET ADO Facade.
Creating Classes for Each Table.
Storing the Prices.
Loading the Database Tables.
The Final Application.
What Constitutes the Facade?
Consequences of the Facade.
Programs on the CD-ROM.
20. The Flyweight Pattern.
Example Code.
Selecting A Folder.
Writing a Flyweight Folder in VB.NET.
Flyweight Uses in VB.
Sharable Objects.
Copy-on-Write Objects.
Programs on the CD-ROM.
21. The Proxy Pattern.
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.
IV. BEHAVIORAL PATTERNS.
22. Chain of Responsibility.
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.
23. The Command Pattern.
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.
24. The Interpreter Pattern.
Applicability.
A Simple Report Example.
Interpreting the Language.
Objects Used in Parsing.
Reducing the Parsed Stack.
Implementing the Interpreter Pattern.
Building an Interpreter in VB.
The Parse Objects.
Consequences of the Interpreter Pattern.
Programs on the CD-ROM.
25. The Iterator Pattern.
Sample VB6 Code.
Filtered Iterators.
Iterators in VB.NET.
Consequences of the Iterator Pattern.
Programs on the CD-ROM.
26. The Mediator Pattern.
Interactions between Controls.
Sample Code.
Mediators and Command Objects.
The Mediator in VB.Net.
Handling the Events for the New Controls.
Consequences of the Mediator Pattern.
Single Interface Mediators.
Implementation Issues.
Programs on the CD-ROM.
27. The Memento Pattern.
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.
28. The Observer Pattern.
Writing an Observer in VB.NET.
The Message to the Media.
Consequences of the Observer Pattern.
Programs on the CD-ROM.
29. The State Pattern.
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.
30. The Strategy Pattern.
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.
31. The Template Method Pattern.
Kinds of Methods in a Template Class.
Sample Code.
Drawing an Isosceles Triangle.
The Triangle Drawing Program.
Templates and Callbacks.
Summary and Consequences.
Programs on the CD-ROM.
32. The Visitor Pattern.
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 VB.
Consequences of the Visitor Pattern.
Programs on the CD-ROM.
Bibliography.