- Shopping Bag ( 0 items )
From seasoned developer Budi Kurniawan comes Internet Programming with Visual Basic, which teaches experienced Visual Basic programmers how to successfully combine two key Microsoft technologies used to drive the Web: Visual Basic and Microsoft Internet Information Server (IIS). This book covers what you as a professional developer needs to know to use VB to write WebClasses that combine all the elements of a robust, scalable Internet application.
This book guides you through the process of building a browser-independent Internet application using VB. Along the way, Kurniawan provides real-world code examples and detailed explanations of exactly what is occurring at each step in the development process. He also offers thorough coverage of IIS objects and concepts used by both WebClasses and ASP applications. You'll learn how IIS applications compare with other technologies, such as ASP, and why IIS applications are much faster and more scalable.
The first part of the book begins by reviewing and comparing the performance of the major Microsoft Internet technologies, including IIS applications. Kurniawan introduces the concept of IIS applications, shows how they're built, and provides related coverage of WebClasses, WebItems, and virtual directories. He also explains the role of ASP objects in IIS, the concept of ODBC and how to set up a Data Source Name connection, and the bases of Microsoft's Universal Data Access and MDAC strategies. In the second part of the book, Kurniawan discusses database optimization techniques, client-side processing, and how to manage state using the URLData property, Session object, database, cookies, and hidden fields. Finally, he addresses the crucial issues of security and successful deployment.
If you are an Internet programmer or are learning to become one, you have to choose the technology you want to specialize in, but never stop watching for the new ones. When a new technology starts to become the dominant player and the one you are specializing in is in infirmity, you should be ready to climb on the new bandwagon. For example, at one time, Common Gateway Interface (CGI) was the main technology of the Internet. It is still being used, but better technologies have been invented and CGI is no longer everyone's favorite.
However, while the entire Internet industry becomes more dynamic every day, the basics remain static, so it is not too difficult to adapt to a new technology regardless of how loud the propaganda is. HTTP (currently at version 1.1) is still the protocol used and HTML (at version 4) is still the language used for content presentation on Web pages.
For this whole process of requesting a file and sending a file to happen, both the server and the user (called the client) must have a valid Internet address. The server address is something like
http://www.apress.com or another type of Internet address. The client address depends on where the user accesses the Internet. When you connect to the Internet through an Internet Service Provider (ISP), for example, you are given a temporary Internet address, so the server knows where to send the requested file. When you are connected through your corporate LAN, you could have a fixed IP address or you could be given a temporary IP address also.
When you click or type in a URL, the following process happens:
What happens after the server sends the requested file depends on the user. The user can just close the browser and walk away or request another file from the server. However, when the server is connected for the second time, it cannot tell whether it is the second request from the same user or a first request from some other user.
The fact that the server cannot remember users who have previously requested pages has a deep impact on how an Internet application is developed. Programmers who are used to the conventional client/server programming might find it confusing at first to figure out how an Internet application works. For now, just keep this information in mind. Further discussion on this issue will be found in Chapter 7.
The architecture of an Internet application is shown in Figure 1-1.
Also keep in mind that the server does not serve only one user. For an Internet application, anyone connected to the Internet can request a page from the server. At times, in popular Web sites, thousands of requests come in simultaneously. And, if you are running a corporate intranet application, everyone with access can request a page. Therefore, it is very important for the Web application to be as efficient as possible.
On the other hand, if you are more inclined toward other products and vendors, your choice is more varied. Getting the right combination of products is often a political issue, not to mention that there is always a risk of incompatibility between products from different manufacturers. A typical Web solution without Microsoft presence could include a Unix or Linux operating system; an Apache (still the most popular today) or a Java Web server; a MySQL, Oracle, Informix, Sybase, or other database; and PERL or PHP or Java as your language of choice. However, because you have chosen this book from the shelf, chances are you are using Microsoft products. If you are new to Microsoft's Internet technologies, please read the next section. It describes the existing technologies and the position of each.
CGI is easy to program and is the slowest Web technology available on the Windows platform. In Windows operating systems, the Web server creates a separate process for each HTTP request and communicates with the process through environment variables and standard input () and standard output ) streams. If 1,000 clients access a CGI application at the same time, the server creates 1,000 instances of the CGI application to handle the requests. Each instance requires its own memory space and system resources.
Because process creation and interprocess communication are time and resource consuming operations, it's not surprising that a CGI application is the slowest compared with other available technologies. CGI applications are usually implemented as a C/C++ executable or with a scripting language like PERL. The output of a CGI application is generated using the basic output functions of the language, for example, printf in C. CGI programs are not as bad in Unix, which is designed to handle multiple processes with very little overhead.
ISAPI is the fastest among the three applications and was developed specifically for IIS as a high-performance Windows alternative to CGI. ISAPI is an API for developing extensions to the IIS server and other HTTP servers that support the ISAPI interface. Compiled as a runtime dynamic link library (DLL) file, the ISAPI model reduces the overhead required by multiple requests because only one DLL is needed for multiple requests.
The first time an ISAPI DLL is requested, the server loads it into memory. Unless the Web server is shut down, the DLL stays in memory waiting for another request. Therefore, there is no overhead for process creation after the first request. Furthermore, ISAPI applications run in the same address space as the Web server and have access to all the same resources. There is no need for interprocess communication. However, ISAPI applications development is also the hardest, requiring implementation using C++/MFC. This factor alone deters many from selecting this solution.
There is also a maintenance problem with ISAPI. Even a minor change requires a recompile and relink of the ISAPI application. Also, an ISAPI DLL can cause the Web server to crash if it is not thoroughly tested before being deployed and run in the Web server process. Fortunately, with IIS 4.0 and later, you can select to run ISAPI DLLs in separate processes, with performance being sacrificed of course. Note that ISAPI applications are not the same as ISAPI filters, which are DLLs that allow preprocessing of requests and postprocessing of responses for site-specific handling of HTTP requests and responses....