Effective Visual Basic: How to Improve Your VB/COM+ Applications / Edition 1by Joe Hummel, Brian Randell, Ted Pattison, Jason Masterman
Pub. Date: 06/01/2001
Publisher: Pearson Education
Featuring nearly fifty rules for best practice, Effective Visual Basic gives the working programmer concrete guidelines for designing better systems and writing better code. Whether the focus is COM, databases, or distributed systems using MTS and COM, this book offers proven, timeless solutions derived from the authors’ years of experience consulting and training in the VB arena.
Effective Visual Basic addresses general practices, from defensive programming to error handling and object-oriented design. In addition, it covers the critical issues in working with COM: interfaces, compatibility, and class design. Rules for building multi-tier applications are followed by a section on best practices for programming the Web. This book also addresses databases and effective data access, among the most important uses of VB.
- Sound programming practices and object-oriented design principles, as applicable in VB.NET as in VB6
- Writing code that runs correctly in both MTS and COM environments
- Improving scalability by not necessarily configuring all your components
- Using XML, IIS, and ASP in Web applications
- Designing classes for efficient database access
Table of Contents1. Shifting from Liberal Arts to Software Engineering.
Make Assumptions Explicit Via Debug.Assert.
Consider #If When Compile-Time Conditions Differ.
Raise Errors to Signal Exceptional Conditions.
Trap Locally, Act Globally: Effective Error Handling.
Know the Difference Between Type and Class.
Embrace Good Object-Oriented Design, Not Just VB.
Prefer UDTs Over Classes for Value Types.
Automate Mundane Tasks.
2. Designing, Building, and Working with COM-Based Components.
Use Custom Interfaces.
Define Custom Interfaces Separately, Preferably Using IDL.
Avoid the Limitations of Class-Based Events with Custom Call-Backs.
Be Deliberate about Maintaining Compatibility.
Choose the Right COM Activation Technique.
Beware of Class_Terminate.
Model in Terms of Scenarios Instead of Entities.
Avoid Activex EXEs Except for Simple, Small-Scale Needs.
3. MTS, COM, and VB—The Middle Tier.
Don't Use Singletons in MTS and COM.
Know When to Use New versus CreateObject versus GetObjectContext.CreateInstance.
Understand the Real Motivation for SetComplete.
Consider an Auto-Abort Style with Transactions.
Don't Reinvent the DBMS.
Don't Feel Obligated to Configure All Your Components.
Avoid Compiling Things into DLLs that You'll Later Regret.
Best Practices for Porting MTS Code into COM.
BestPractices for Writing Code that Runs on MTS and COM.
4. The Web and VB.
Manage Application State to Maximize Efficiency.
Manage Session State to Maximize Scalability.
Understand the Differences Between DCOM and HTTP.
Write COM Components for Scripting Environments (like ASP).
Understand How Your COM Objects Interact with ASP.
Use XML Instead of Proprietary Data Formats.
Be Deliberate about Presentation vs. Business Logic.
Use XSLT to Move from Data to Presentation.
5. Effective Data Access from VB.
Don't Over-Encapsulate Data Access.
Never Hold Database Connections as Data Members.
Deadlock is Common; Develop Defensively.
Use Firehose Cursors whenever Possible.
Make the Right Data Searching Decision (Avoid SelectSingleNode Abuse).
and post it to your social network
Most Helpful Customer Reviews
See all customer reviews >