Have one to sell? Sell yours here
Visual Basic Object and Component Handbook
 
See larger image
 
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Visual Basic Object and Component Handbook [Paperback]

Peter Vogel (Author)
5.0 out of 5 stars  See all reviews (15 customer reviews)


Available from these sellers.



Book Description

Prentice Hall Series on Microsoft Technologies June 15, 2000
This is the ultimate guide to Visual Basic objects and components -- the key to successful enterprise and web development with VB. It contains extensive sample code, plus real-world insight into every key VB object development issue. Peter Vogel starts with a detailed look at the issues involved with designing objects and their interfaces: how to choose which methods, properties, and events to use; build collections; and combine objects to create components. Next, he introduces each key object technology Microsoft provides for web and enterprise development, including the Component Object Model (COM), Active Server Pages (ASP), and the Microsoft Transaction Server (MTS). Discover how to create objects that pass data to ActiveX Data Objects; build components that work with Microsoft Transaction Server, and more. The book contains extensive, up-to-date server-side coverage, plus a practical introduction to Windows 2000 COM+ Services.

Editorial Reviews

From the Inside Flap

Preface

In the Microsoft and Windows world, objects and components form the foundation on which everything else rests. The mortar for this foundation is Microsoft's Component Object Model (COM) specification and implementation. The COM specification describes how objects can be assembled into components and how components can work together to form applications. The implementation of COM in the Windows operating system provides the support to take advantage of this powerful technology. To participate in the world of COM, you need to create components that will work with any other COM-compliant development tool and application.

I wrote this book to provide the working Visual Basic programmer with something that I wanted: A one-volume reference to writing COM-based objects and components using Visual Basic. My goal was to provide, in one place, in plain language, everything that the Visual Basic programmer would need to know to create components.COM and Visual Basic

COM is constantly evolving. Currently COM is being expanded into the COM+ specification in Windows 2000. In both the COM and COM+ models, developers create objects and then combine them to form components. Once built, your components can be integrated with applications built with other development tools ranging from C++ to Delphi to Object COBOL. COM-based applications that can use your components include both Microsoft Word and Internet Information Server. Building on COM, Microsoft has also defined a series of environments—including Microsoft Transaction Server and ActiveX Data Objects—that require objects with specific characteristics. It's a very big world out there.

Fortunately, Microsoft has provided a terrific tool for creating objects: Visual Basic. Much of the drudgery involved in creating COM objects and components is taken care of automatically by Visual Basic so that you can concentrate on solving problems. There's still a lot that you have to know, as this book demonstrates, but Visual Basic lets you concentrate on the important issues.

I've taken a very practical approach in this book. Throughout the book, I'm going to tell you two things:

If you want to do this using Visual Basic, here's the code that you should write.

If you write this code, here's what Visual Basic will do.

Or, more simply: If you want this, code this; if you code this, you'll get this. Where Visual Basic gives you different implementation choices, I've described the costs and benefits from a design and maintenance point of view for each choice. I've also provided benchmarking information on the impact on your code's performance. I can't tell you what the right answer is for each one of these choices, because too much depends on what you are trying to accomplish with your program. However, if you're wondering what threading model to use or whether to declare your parameters as ByVal or ByRef, this book will give you the background to make an informed decision.

I've given design considerations precedence over performance. I don't want to suggest that performance isn't important-the application with the sub-two-second response time and a few bugs will be implemented before the application with plus-six-second response time and no bugs. But for your application to succeed, you must first get the design right and then make the adaptations necessary to get the performance you need. I firmly believe that it's often better to abandon a project than compromise the design in order to meet the performance goals. For most applications, the life cycle cost of a bad design will swallow whatever benefits the application was supposed to deliver.

Good design and good performance are not incompatible. If the design is right, then you will probably find that modifying it where necessary to improve the performance is relatively straightforward. Throughout this book I will be pointing out where you have opportunities to ensure that your component will run quickly, along with the costs and benefits of building your component that way.The Knowledge Gap

Back in the early '80's, I started out programming on mainframe computers and creating linear programs-programs that started executing on the first line of code and kept going until they got to the end of the code. I inserted Do loops, If...Then statements, and subroutines or functions to break up the monotony, but mostly my programs began at the beginning and ran until the end.

Programming doesn't work that way anymore. My first exposure to this new world was when I started creating programs using Visual Basic 3.0. My first exposure to "programmer's culture shock" was when Visual Basic introduced me to event-driven programming. In event-driven programming I had to give up control over the execution of my program; the events that were triggered by the user determined the order in which my code executed.

When I started developing programs in Visual Basic, I also began to work with the objects that made up the Visual Basic environment. I had experimented with object-oriented programming earlier in my career by learning Smalltalk, the language that pioneered object-oriented development. I discovered that, while I had learned the syntax of the language and could write Smalltalk code, I still couldn't create Smalltalk applications. I just didn't know where to begin. Visual Basic turned out to be the tool that moved me from the world of linear programming to the world of working with objects.

For the last three years, in addition to developing Visual Basic applications, I've been teaching Visual Basic to developers for Learning Tree International. Many developers in my classes suffered the same problem that I had in getting started with object oriented development. These programmers found themselves in the position of knowing all the necessary syntax, but unsure about how to put it all together. Experienced developers in my classes found that they knew only part of what Visual Basic could do for them.

It was to address this gap between knowledge and performance that I wrote this handbook. In addition to teaching and developing, I wanted to provide developers not only with the knowledge on how to use Visual Basic's ability to create objects, but also the "when and why" of using objects.The Handbook

I edit the Smart Access newsletter (the leading source for technical information on Microsoft Access). While working for Learning Tree, I also wrote a course on developing Web-based applications. If you read the various magazines about programming with Visual Basic, then you've probably read an article that I've written. As a result, I've had a lot of experience in explaining technical concepts to programmers. More important, I've had a lot of feedback from students, teachers, authors, peers, and others on what works and doesn't work. I've learned that the key to presenting information successfully is to provide a solid structure to organize the material.

This handbook's structure is simple. The first three parts of the handbook discuss designing objects, creating objects and components, and integrating components into specific environments. The fourth part is a "heads-up" look at what changes you can expect in Windows 2000.

Part 1 of this book covers the issues involved in designing objects. In this part, I discuss what you should consider when designing the interface for your objects. Among other topics, I'll look at deciding when you should use a method or a property, and how to derive your object design from your data design. I also show you how to use Visual Modeler, the object design tool that comes with Visual Basic.

Part 2 provides you with a complete guide to creating objects and components, including the code you need to write to implement methods, properties, and events. You'll see how to develop objects that act as collections and how to create objects that create other objects. In this part I also show you how to combine your objects to create components and cover both the why and how of implementing interfaces. Thanks to Visual Basic, your components can be as complicated as Microsoft's Data Access Objects or as simple and powerful as ActiveX Data Objects.

The examples in Part 2 are deliberately simple: Just enough code to demonstrate the technique. However, objects are really interesting only when they are put together and interact with each other. To demonstrate this, most of the chapters in Part 2 end with a case study that shows the various techniques in action. Even in these final sections, I've kept the standard "business" code to a minimum so that you can concentrate on the code that makes the objects work. The error handling that a real business application would require is missing, for instance.

With a foundation on how to build objects and components in place, Part 3 looks at how to create objects that will work in the specialized environments that Microsoft has defined. You'll see how to create an object that can pass data into to ActiveX Data Objects and what you must do to create a component that will work with Microsoft Transaction Server. In Part 4, I look at what Windows 2000 developers can expect to find under COM+ and Component Services.Benchmarks

Throughout Part 2 of this book I've given examples of the impact on execution time of the programming decisions that you will make. If you are trying to decide whether to use a ParamArray or a set of optional parameters, these benchmarks should provide you with the information to make a performance-based decision. However, performance isn't everything, as you know if you've ever tried to maintain someone else's "highly optimized" code. And, in many cases, a foolish emphasis on writing the fastest code leads to introducing bugs. To paraphrase the immortal words of the authors of The Fundamentals of Programming Style, to some programmers, efficiency often seems to mean getting to the wrong answer as fast as possible.

Overreliance on benchmarks can be a mistake. As you look at the benchmark results remember that I repeated most operations 1000 times. So, when I say that an operation took 2 milliseconds on my computer, that really means that one execution took 2/1000 milliseconds. You should recognize that even a difference of an order of magnitude may translate into less than a millisecond. Do you really need to worry about a millisecond? And, if you do, shouldn't you be writing this code in C and not Visual Basic? If you are concerned about the assumptions that I've made, you can find the code in Appendix B, the Benchmarking Code appendix. You can also download the code (and the COM Add-in that generated it) from my Website at phvis.Keep in Touch

I've had a lot of fun writing this book and exploring Microsoft's world of objects. I wrote the book because I wanted to provide a single reference to all the information that you might need when building components with Visual Basic. I hope you get as much satisfaction out of using this book as I did writing it. If you have any questions, issues, concerns, or recommendations don't hesitate to drop me a line at peter.vogel@phvis. You're also welcome anytime at the PH&V Information Services website at phvis. In addition to finding the Visual Basic COM Add-in that generated the benchmarks in Part 2, you'll find white papers on a variety of topics in application development.

And, for those of you who've read Ken's Foreword: the Empire State Building has 6,500 windows (though I suspect that the number has been rounded), and the boiling point of bleach (typically, water with a 5% solution of NaOCI) is close to the boiling point of water at 212°F/100°C.

From the Back Cover

  • Enterprise, Intranet, and Internet Development
  • Windows 2000 COM+ Services
  • MTS, ASP, COM/DCOM, COM+, ADO
  • Benchmarking and Design Guidance

The Complete Guide to Object and Component Use, Design and Development!

  • Integrating VB6 objects and components with databases, Web sites, and Internet applications
  • MTS, ASP, COM/DCOM, COM+, ADO, and more
  • Covers the entire lifecycle: planning, design, implementation, distribution, and beyond
  • Data bound objects, design time controls, ActiveX, Internet, and script components, COM add-ins, and more
  • Detailed server-side coverage
  • Real benchmarks and practical design guidance

The developer's guide to VB objects and components!

Visual Basic Object and Component Handbook is the resource for building VB6 objects and components—the key to successful large-scale VB development! Whether you're developing for the enterprise, the Web, or both, Peter Vogel gives you the real-world insight and industrial-strength code you need to get results.

Start with a close look at the issues involved with building objects and their interfaces using VB6—including important design and maintenance tradeoffs you must know about up front. Next, learn all the fundamentals: choosing and implementing methods, properties, and events; building collections; combining objects into components; and more.

Then, master every key object technology Microsoft provides for distributed development, including the Component Object Model (COM), Active Server Pages (ASP), and the Microsoft Transaction Server (MTS). Learn how to create objects that pass data to ActiveX Data Objects; build components that work with Microsoft Transaction Server—even work with Windows 2000 COM+ Services.


Product Details

  • Paperback: 668 pages
  • Publisher: Prentice Hall PTR; Subsequent edition (June 15, 2000)
  • Language: English
  • ISBN-10: 0130230731
  • ISBN-13: 978-0130230737
  • Product Dimensions: 9.1 x 6.9 x 1.8 inches
  • Shipping Weight: 3 pounds
  • Average Customer Review: 5.0 out of 5 stars  See all reviews (15 customer reviews)
  • Amazon Best Sellers Rank: #2,195,369 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, read author blogs, and more.

 

Customer Reviews

15 Reviews
5 star:
 (15)
4 star:    (0)
3 star:    (0)
2 star:    (0)
1 star:    (0)
 
 
 
 
 
Average Customer Review
5.0 out of 5 stars (15 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

39 of 39 people found the following review helpful:
5.0 out of 5 stars VB Programmer Blown Away, February 8, 2001
This review is from: Visual Basic Object and Component Handbook (Paperback)
Wow. Forget about the fact that this isn't put out by a well-known computer-related publishing house like Wrox or O'Reilly. Forget about the fact that it isn't a "Learn in 21 Days" or "Bible" series. Forget about that, as I write this, only a few people have reviewed this book. This book is flat out awesome. Get it.

I am a VB programmer with about 1 1/2 years of experience. I started off with a basic VB book, moved on to using VB with databases, and it was at this point I started realizing how important objects were. I needed to separate my client projects from much of the code behind the scenes and put that code in to Active DLL's or EXE's so many different client projects could access it over many different methods (desktop, distributed over our network, or through the Internet). I mean that's the power of VB! I bought "VB COM" by Wrox and while it taught me some things, it was really just an overview. I also bought "VB Beginning Objects" by Smiley but it was too basic and written more like a 700-page novel. They both had decent examples of objects at work, but neither of those books were good references. I guess the best way to describe my situation after reading these two books was that I knew what objects were, I knew the basics of programming them, and yet I still couldn't apply what I learned to the current stuff I was working on at my job. That's when I knew I needed more.

Along comes this book and I now feel like I am a full fledged VB object programmer. There's none of this "Here's how you write a Select Case within an object"... the author cuts right to the chase starting at Chapter 1, page 1. Within the first five pages, I already had the author discuss some of the main issues I was concerned and thinking about-- ie, "It seems the more flexible you want to make your object methods, the more parameters you have to pass to them." I was impressed. Already something I was thinking about in my current project.

There are 16 chapters covered, beginning chapters on designing, coding the objects, and COM interfaces, advanced chapters on COM Add-In's To ActiveX Objects, Deploying to ActiveX Documents. There's a great chance that if a certain topic involves objects, this book has at least a mention of that topic. This has been the best programming book I've bought in awhile and I will without a doubt explore more books by this publisher and author.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


8 of 8 people found the following review helpful:
5.0 out of 5 stars The definitive guide for "thinking with objects", November 22, 2000
By 
"ptodd" (Houston, Texas USA) - See all my reviews
This review is from: Visual Basic Object and Component Handbook (Paperback)
I first read this for myself, and have since recommended it to every programmer I know...from beginners to professionals... It not only leads a beginner ( and some old-timers) through the thought process for developing in a component model, but shows them how to consider certain situations that they will have to answer if they do any "live" programming. For the professional, it not only opens up new ideas on how to move to the next level in terms of tighter code, but also reminds us of key concepts - some of which we may have forgotten or just gotten lazy in using. A must have for the tech leader of any development team.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


8 of 8 people found the following review helpful:
5.0 out of 5 stars Invaluable Reference on Object and Component Development, July 10, 2000
By 
Jeff Block (Canton, Ohio USA) - See all my reviews
This review is from: Visual Basic Object and Component Handbook (Paperback)
As a person who is constantly reading new material, books, eNewsletters, etc., I was most impressed with the content of this book. The book covers the design/implementation decisions that have to be made to make an object and/or component as effective as it can be. The auther discusses the impacts of various design decisions and does not really tell you what to do, but rather outlines in clear, consise language the implications of the decisions and allows you to make the design that works best for your situation.

I have long been wondering if I was making the correct design decisions and looking for a book that outlines the alternatives that can be implemented to develop enterprise solutions that perform well and are maintainable!

After the specifics of general object and component writing, there are specific chapters that target ActiveX Controls, adding Data Binding behavior of your objects, MTS components, and much, much more (read the table of contents). These chapters are written to be practical guides to the implementation of these specific technologies with clear, concise languange and examples! While the W2K and COM+ coverage is light, it outlines some of the items that warrant further investigation on your own.

This book sure to be one of the most often used reference books in my library on VB. I recommend it highly to anyone asking about object/component design and development and I highly recommend it to you now.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews











Only search this product's reviews



Tag this product

 (What's this?)
Think of a tag as a keyword or label you consider is strongly related to this product.
Tags will help all customers organize and find favorite items.
Your tags: Add your first tag
 

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Listmania!


Create a Listmania! list

So You'd Like to...


Create a guide


Look for Similar Items by Category


Look for Similar Items by Subject