Page #15 (Chapter 1 - Visual Basic and the Web)

Chapter 1 - Visual Basic and the Web

Visual Basic Developers Guide to ASP and IIS
A. Russell Jones
  Copyright 1999 SYBEX Inc.

Why Write a Web Application in VB?
You can write Web applications in many languages: Perl, Python, Java, C, C++, even QuickBasic or Unix shell scripts. So why would you choose to write a Web application in Visual Basic? Whenever you need to make decisions, it's always good to look at the requirements first. Let's look at the requirements of a Web application and at how well VB meets those requirements. The five major requirements are:
Database connectivity  A Web application often accumulates and manages critical information, storing it in a database for future reference. It also uses that information store to provide specific services. Therefore, a Web application language should be good at storing and retrieving information—preferably in databases. Since version 3, VB has had industry-leading database connectivity and it still does.
Speed  A Web application must often service many clients. Visual Basic, compiled into native code, is nearly as fast as C.
String handling  A Web application must be able to handle string searches, concatenation, and token replacements. Visual Basic has excellent string-handling ability.
Security  A Web application must be able to handle security demands. Any compiled language provides greater security than an interpreted language. Visual Basic meets this requirement equally as well as C, and better than Java or a scripting language such as VBScript or JavaScript.
Transactions  A Web application often needs to perform several actions that must complete successfully for the data to remain valid. When working with a database, you usually wrap such actions in a transaction. A transaction is a contract that guarantees that the entire set of operations either will succeed or will fail in such a way that no changes will be made to data. The classic example of a transaction is that of a checking account. When you deposit a check, the bank debits the amount from one account and credits the same amount to another account. Both must succeed, or both must fail. The dual act of debiting one account and crediting another is a transaction. Through Microsoft Transaction Server, you can perform multiple actions in your Web pages, even use multiple objects to accomplish the transaction. Although you don't always need transactions, when you do need them, you need them badly.
In addition to the five major requirements, there are others that are somewhat less important:
Familiarity  You write better code faster if you're familiar with the language. Because all of you are Visual Basic programmers, you're ahead of the game here.
Debugger  You also write better code if you have a powerful debugger. Here Visual Basic and Visual Studio are leaders. The capability to view and change the contents of variables, rewrite code on-the-fly, move the execution pointer, step through code in DLL projects, step through code in ASP files, and step through code running in the browser—all from your Visual Basic project group—is awesome debugging power. Until Visual Studio 6 was released last year, ASP debugging was done through Response.Write statements in concert with Response.End statements, which is analogous to working in Visual Basic if the only debugging capabilities you could use were Debug.Print and Stop statements.
Code/object reuse  Sure, you can do this in any language, but I'll bet no other language has as many third-party tools, libraries, and examples available as Visual Basic. I suspect that many of you reading this book also have a large set of routines and objects that you reuse when appropriate. Many of these routines will work just fine in a VB-based Web application, so once again, you're probably ahead of the game here.
As you can see, Visual Basic is as suited for Web application development as it is for any other type of program—it's a general-purpose language and meets these requirements easily.



Visual Basic Developer[ap]s Guide to ASP and IIS
Visual Basic Developer[ap]s Guide to ASP and IIS
ISBN: 782125573
EAN: N/A
Year: 2005
Pages: 98

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net