WebClass to implement dynamic web programming theoretical articles
(Author: Suhongtu Super 2001 at 15:50 on January 10)
For a few more time, I used to explore how to use ActiveX DLL technology to replace simple pure ASPs to implement core code and commercial logic in detail. Appropriate use of ActiveX DLL technology to have a lot of benefits when building a dynamic web site, which is obvious, but still needs a separate ASP file to create and destroy the ActiveX DLL components we have written, a large number in ASP Using ActiveX DLL is unrealistic, and our ASP programming is still not written as usual applications, because messy ASP code and HTML code are intertwined together, and, whether it is a simple ASP program or encapsulated ActiveX DLL ASP program, a biggest drawback is difficult in debugging during project development, such as difficult to set breakpoints and suspend procedures to view the value of certain variables. Is there a way to have two suites, guarantee the efficiency of developing a web program, can you easily debug and write like usual applications? The answer is of course affirmative, Microsoft introduces the concept of "WebClass" after the VB6 version, and adds a project type called "IIS Application" in the new project. WebClass is the use of Microsoft's use to make programmers to develop web programs like developing ordinary applications! Speaking of "IIS Application", everyone will think that this is the difference between the ASP program? Is the ASP not running on the web app on IIS? In fact, this is a small error in Microsoft's name, so that everyone is easier to confuse in the name. We should now clear that "IIS Applications" is the use of WebClass technology to implement and ASP's same functions, which avoids the disadvantages of ASP, such as source code is transparent, interpretation is slow. In fact, the WebClass application is also a VB component. It will be compiled with the Web application, and its running speed is greatly improved, and the source code and core technology and commercial confidential are also avoided. WebClass is essentially a VB component, which is specifically that WebClass is an ActiveX DLL. He allows you to write server-side code to respond to browser requests from users. For the user, an IIS application seems to be composed of a series of HTML pages; for developers, an IIS application consists of some special type objects called WebClass. WebClass can directly access all ASP built-in objects (Request, Response, Application, Session, Server). Any Web project developed using ASP can be implemented in WebClass. Since the concept of HTML template is introduced in WebClass, it is effective to avoid the defects from the program code in the ASP and the defects brought by HTML code, and the separation of the commercial logic layer and the final performance layer (some similar current XML) And XSL form), greatly improves the development efficiency of web projects. The IIS application is similar on the surface and the Active Server Pages application. Both applications displays dynamic Web sites and are all processed on the server instead of their processing on the client. However, each has its own unique advantages: (1) Active Server Pages are suitable for script developers who are interested in making web pages, which provides unique capabilities that mix scripts and HTML mix. (2) IIS applications are suitable for constructing a Visual Basic developer based on a web application rather than a web page. IIS applications allow complex transactions, and almost any browser or platform can easily access it.
Developing a Web project using the IIS application can have the following advantages: (1) Familiar development environment and model. You can use the Visual Basic to add classes, modules (Model), or any Visual Basic ActiveX part, which is easy to debug and write. (2) Wide use of use. Can be supported by most browser. (3) Reusable components. Similar to object-oriented programming; each object can be accessed each other. (4) Code and HTML phase separation: and write ASP applications, SERVER-side handler and Client end programs are separated, easy to maintain and modify. (5) You can customize the handling event, so write methods. Let's take a look at the specific components of WebClass: WebClass consists of HTML templates and custom WebItem. (HTML Templates and Custom WebItem Call WebItem is of course not necessarily template and custom WebItem. (1) An HTML template file is an HTML page associated with WebClass. When WebClass receives a request, it can send the browser to the HTML page. Differences for templates and conventional HTML pages only before sending pages to your browser, it often contains the replacement area that WebClass can process (usually defined by "WC @" tab). This allows you to customize your own response. (2) A custom WebItem is a program resource consisting of one or more event handlers. These event handles are called by the browser when the page load or user selects an HTML element. These event handlers can generate a response to the browser or to pass the process to another WebClass. The roughly flow of a complete WebClass application is as follows: A. Specifies a WebClass (such as Test1) as a project B initiated first. Activate this WebClass_Start event C in this WebClass (TEST1). The WriteTemplate method for calling an HTML template is called in the WebClass_Start event event in Test1, such as Check. WriteTemplate here's CHECK is a HTML template D belonging to Test1 WebClass D. If you have