Any expert will tell you that designing systems is an iterative process. The first design is usually not the answer to all possible system scenarios for such reasons as time constraints for system deliverables, the constantly changing list of end-
user
requirements, and limitations of the current technologies. Programmers and architects who are faced with these challenges will learn to construct designs that can
evolve
with the least amount of disruption.
[Previous] [
Next
]
Contents Overview
This book is made up of three sections. The goal of the first section is to lay the foundation for understanding and appreciating the design patterns discussed in the chapters of the second section. The appendixes in the third section cover topics you'll need to be familiar with to use this book effectively.
Part I: Object Basics
This section provides an overview of the
hows
and whys of Visual Basic object-oriented programming, which is made possible by COM (the magic behind the curtains). You do not have to be an expert on COM, but you should have a solid understanding of certain aspects of it that will affect the performance and the behavior of your Visual Basic application. This section raises the curtains by explaining specific features of COM and COM's impact on Visual Basic.
Part II: Design Patterns Directory
This section comprises several chapters, each dedicated to explaining a specific design pattern. To help you understand and select effectively the appropriate design pattern for your scenarios, chapters in this section
adhere
to the following structure:
-
Purpose
States the intent of the design pattern.
-
Utilization
Describes the design problems that
warrant
the use of the design pattern.
-
Scenario
Describes a situation that motivates the need to use the design pattern.
-
Object Model
Presents the layout of the design pattern using standard object notation, such as an OMT class diagram; the object model illustrates the design pattern solution in diagram form.
-
Roles
Describes the roles of each object in the design pattern.
-
Relationships
Describes the interactions of all objects in the design pattern.
-
Ramifications
Describes the benefits and drawbacks of using the design pattern.
-
Implementation
Explains how to implement the design pattern in Visual Basic.
-
Sample Application
Provides a complete working implementation of the design pattern along with an
in-depth
analysis.
-
COMments
All the design patterns described in this book can be implemented in Visual Basic to take advantage of the technologies
offered
in COM and ActiveX. Therefore, when appropriate, I'll provide further insight on these effects, based on the implementation of the design pattern specified.
-
Related
Patterns
Refers
briefly
to other related design patterns described in the book.
Because all design pattern chapters are identically structured, selecting the appropriate pattern for a given problem is a logical process, as described in the following section.
Part III: Appendixes
This section has two appendixes. Appendix A describes the object notation used in the illustrations in this book. Appendix B briefly discusses some of the issues involved in working with interfaces and classes, such as defining COM interfaces and classes in Visual Basic, freezing an interface contract using features in the Visual Basic intergrated development environment (IDE) and using the COM interface definition language (IDL), and supporting Automation in Microsoft ActiveX
components
created in Visual Basic for the benefit of scripting languages such as Microsoft Visual Basic, Scripting Edition (VBScript) and Microsoft JScript.
Selecting a Design Pattern
{% if main.adsdop %}{% include 'adsenceinline.tpl' %}{% endif %}
To select a design pattern, you should first know what problem you are trying to resolve. By reading the "Purpose" section of the design pattern chapters, you can identify a few design patterns that might provide the required solution. Next, read the "Utilization" section of each chapter you have
chosen
. This section provides brief, explicit instances that
illustrate
when that particular design pattern should be utilized. (This defines your design problem.)
At this point, you can compare the "Utilization" sections between chapters to help you make an
intelligent
choice. If you still want more information, read the "Scenario" section of each selected chapter, which provides a concrete example of implementing the design pattern in question. When you select your design pattern, read the entire chapter to appreciate fully how the design pattern
solves
your problem from design to implementation. Finally, explore the sample applications on the companion CD at the back of this book—they bring to life the solution you hope to duplicate.
In some cases, your design problem might not clearly match any one design pattern; it might require a hybrid solution of more than one design pattern, which is completely acceptable. In finding a solution, you might even discover or create a pattern not covered in this book. Maybe the scope of your problem is too broad. Refining the scope by restructuring your design can help significantly in finding your solution. Remember there is no one-
size
-fits-all solution to designing the perfect object-oriented system, if there is such a thing. You just get better at it with experience—and with the help of this book.
You don't have to read this book from front to back to benefit from the material presented. Feel free to skip around. If you consider yourself an expert Visual Basic object-oriented programmer, you can skim through the next two chapters and
spend
most of your time in Part II. If you consider yourself fluent in the language features that support the fundamentals of object-oriented programming, but you are wary of COM threading models, go straight to Chapter 3, "COM Threading Models." My point is that this book is not a how-to guide in which each chapter is a prerequisite to the chapter that
follows
; rather, each chapter is independent and has its own story to tell.