The invoked ASP page accomplishes three basic steps: it retrieves the input parameters through Request.Form, it uses the input parameters to set up and run a SQL query, and it prepares a new HTML page with a portion of the data retrieved. You can distinguish three logical layers, apart from the n-tier architecture of the system: the UI on the client, a first level of code on the server to handle the requests from the client, and a second layer of code that accomplishes the request (almost always retrieving data from storage). On the UI side, you have HTML with a little bit of script. On the server side, you can choose among a variety of solutions depending on the hardware platform and possible portability issues: ASP, ISAPI, Netscape API, Java servlets, or CGI. Behind any of these, there's always a database accessed through ODBC and SQL.
Revolutionizing the Web
What's new from Microsoft is a set of updated, improved, and integrated solutions that will populate the three logical layers I mentioned previously. Once and for all, forget any idea of browser independence. To take advantage of the new Web technologies, you absolutely need Microsoft® Internet Explorer 4.0 or higher and Windows NT®.
Figure 2 summarizes the new technologies available for reinventing your Web app. On the client side, you can rely primarily on DHTML to give your front end a cool and attractive look. By using filters, transition effects (see "Slideshows
Made Easy with Dynamic HTML"; by Lanie Kurata and Jacqueline Sowell in the May 1998 issue of MIND), hidden DIV sections, trappable mouse events, and above all, the ability to update page content, you can really give life to your Web pages.
On the other hand, the more complex and richly animated an HTML page becomes, the less readable its source code can be. Only tools like Microsoft FrontPage® 98 can cope with them and successfully interpret the content. When programming becomes this intricate, components are the only safe way to go. Thus, DHTML scriptlets are a good compromise to make your pages full-featured as well as reusable, without losing too much in readability and maintainability.
A third important technology that affects the client side of a new Web
app is XML. However you design the app, you need to receive streams of data. This was a nonissue until remote scripting came on the scene. Before DHTML, you never had streams of data from the server to interpretyou just had an old page and a
new page. Now you have the possibility of updating the content of the current page, and you might receive the data either synchronously or asynchronously.
Here's where XML comes into play. XML provides an excellent way to format the data that's exchanged between different modules on a system. Does your client need a collection of records from the server? Just gather them all, package the content into an XML buffer, and send it across the Net. The receiver will be able to get the data as well as a description and attributes for it. This makes it easier for a client-based component (say, a DHTML scriptlet) to interpret that stream and associate the various chunks of information with specific HTML tagsjust like you do on a Visual Basic form when you extrapolate fields from recordsets and link them to graphic controls.
Communication between the client and server is still based on ASP. Everything that you can invoke on the server takes the form of an ASP page. Remote scripting, for instance, allows the client to execute a method of an object located on the server. This object is identified via ASP and JScript. (JScript® is needed here because, unlike VBScript, it's able to create and evaluate dynamic functions through its new operator.) A remote scripting component exposes its programming interface the same way a DHTML scriptlet would, namely via a JScript dynamic function.
Once you figure out a way to establish a direct connection between the client and the server, you also have a channel for sending data. Remote scripting is the middle layer and works more or less as a stub module. It takes care of providing actual data by calling more specialized components. It can also return such data to the client after applying an XML filter. Behind remote scripting there are scriptlets at work (originally called server scriptlets). They are real COM objects (with registration information, version numbers, and ProgIDs) driven by a piece of script code that defines methods and properties following the function-based JScript approach. A server scriptlet is typically an invisible component you can call to do the dirty work. It can issue SQL queries through ADO and return the recordset to the remote scripting layer.
Remote scripting is not the only way to access data without leaving the current page. Another technique relies on data binding. In a nutshell, data binding is an open channel between one or more controls on the client HTML page and a remote ODBC-compliant data source. The client page gets updated incrementally as the data comes in. What's important is that during this time, the user is completely free to do something elsesuch as filling in other objects in the same page, looking at images, reading text, and so on. In other words, if you linked a <TABLE> with a data-binding source (also known as a DataSource Object, or DSO), you don't have to wait for the entire recordset to download before using the page. Simply put, you have a <TABLE> tag that grows in seconds. More importantly, you don't have to do anything!
|