Microsoft's ActiveX technology is not limited to the browser clients; its foundations are extended to the Web server, as well. The Active Server consists of the Active Server pages, components, and the scripting (VBScript and JScript) engine. The Active Server operates on Windows NT 4.0 system services and the Internet Information Server (IIS) Web services. You can write server-side scripting, connecting server objects and accessing databases, that outputs HTML code to the client browser. The Active Server's capability varies from simple scripting to enterprise data access and scalable transaction management functions.
Microsoft's mission statement for the ActiveX Server system (or Active Server, as it is called now) is "to address the development and deployment requirements for robust and scalable line-of-business server applications for the Web and beyond." This sums up the Active Server's capabilities and functionality.
The Active Server architecture supports the component-based scripting
and adds data access facilities. It also adds scalability and
data concurrency by transaction services. The Active Server components
are built on the n-tier client/server application development
paradigms.
Active Server Case Study (MSN) |
The Microsoft Network (MSN) home page was originally developed using traditional methods-mostly Visual C++ code. It took Microsoft 4-person months to develop the initial working system. At that point, the bottleneck was development and not content. As the Active Server products began popping up, the developers at Microsoft changed to the Active Server architecture and it took them one-person week to develop the system. Now, it is the graphic designers and Web page HTML authors who take up the time because system development no longer creates a bottleneck. In the process, Microsoft gained a flexible system that is adaptable and upgradable. As a development time rule-of-thumb, Active Server will take the same amount of design time as traditional methods, but you will be able to code, test, and roll out the Web pages in a fraction of the time taken for traditional Web design models. However, HTML authors and graphic designers should be familiar with HTML, graphic packages like the Photoshop, and, on the programming end, VBScript and JScript. On the configuration end, you should place all Web servers in a remote "Web farm" and replicate the contents from the content master to the Web servers several times a day. As an additional note, you can do the same thing even if you are a small business, as many of the ISPs offer the Web farm service. |
From a Web application, one of the main components is the Active Server pages. The Active Server pages' capabilities are extended by ActiveX Server components-examples are database access, transaction processing, messaging, and so on. Most, if not all, of these extensions are built on the OLE automation. Figure 8.1 shows the hierarchy of the Active Server components.
In a simplistic sense, Active Server pages (code named "Denali") are nothing but server-based HTML pages with ActiveX controls and VBScript or JavaScript routines to respond to events. The scripts run in the server as opposed to in the client browser. The server pages are files with an .ASP extension. What provides the power to the Active Server pages are the programming objects like server, application, and session. These objects help to coordinate a user's interaction through various HTTP requests. The Active Server pages have the capability to provide security through the generally accepted cryptographic techniques, including certificates and key organization.
Figure 8.1 shows a sample interaction between a Web client and a database through an Active Server page. When you look at the information flow (shown in Figure 8.2) and the architectural block diagram (shown in Figure 8.3) you can see the interaction between OLE automation, Active Data Objects (ADO), OLE DB, and ODBC drivers. Figure 8.4 shows the simplified hierarchy of an Active Server page.
Active Server Page scripting is similar to client-side scripting.
The language is still VBScript or JavaScript. The Active Server
pages have the OnStartPage and OnEndPage events
for initialization and termination procedures. You can run a script
in any server with the "runat=server" parameter
with the script procedure. The built-in objects available in the
Active Server Page are: Server, Session, Application,
Request, and Response.
Deciding Whether to Use Client-Side or Server-Side Scripting |
You should use client-side scripts for error checking, for user interaction, and to connect client-side ActiveX objects. Client-side scripting reduces network traffic (which is a factor for intranet-based applications and is of great importance for Internet-based applications). Server-side scripting is required when you need to do browser-independent processing or back-end processing like dynamic page generation with the latest data, database access, and so on. Also, with server-side scripting, you can implement security more robustly and possibly more easily. Another reason to go for server-side scripting is to provide access to legacy systems where the server scripting effectively acts as a middleware. Another point to remember is that usually the server-side scripting will be done by server developers and Webmasters, while client-side scripting will be done by all who are developing Web pages. |
Table 8.1 lists the objects and a sample of their properties,
events, and methods. This table is by no means meant to be a full
reference, but to give you a flavor of what is available with
the Active Server page objects.
Object | Description |
Server | The object to interact with the server. As of now, the Active Server components base set are: advertisement rotator, browser capabilities, database access (ADO), content linking, and file access. These are available from the Server object. You would use the script statements like Server.CreateObject("MSWC.Adrotor") to create these objects. The Active Server uses OLE automation for implementing many functionalities. |
Session | A single browser's interactions viewed from the server. The Session object will persist over multiple Web pages and HTTP requests. |
Application | Object that can be used at the application level from the server. |
Request | Object to get information from the client. The functions include Request.QueryString, Request.Form, Request.Cookies, Request.ServerVariables, Request.ClientCertificate. |
Response | Object to send information to the client browser. For example, Response.write(<string>) would output the string to the browser. |
The Active Server components are technically OLE automation servers. They run as an out-of-process COM object on the servers. Since they are COM objects, they can be interfaced using the scripting languages. The Active Server components can live anywhere in the network. The Distributed COM (DCOM) technology provides the location independence for these Active Server components.
The Active Server components make it easy to compartmentalize
functionality and distribute it over networks local, intranet
or the Internet, depending on the Web applications. In fact, for
complex applications, Web servers are backed by many application
servers doing indexing, merchant services, messaging, and so on,
with the distributed components. You can also have redundant application
servers for load balancing and fault tolerance. Systems like merchant
servers and search engines should be a 24 ´ 7 (or round-the-clock)
operation-especially if they are your main business.
IIS Services for the Active Server Framework |
In a nutshell, the Microsoft IIS provides the following built-in services under the Active Server framework: Network Services, Active Server Pages, NetShow, FrontPage Services, Internet Services Manager, Index Server, SSL, Crystal Reports, ISAPI, and Data Access. You will recognize many of these services from the block diagrams and descriptions in this chapter. Network services include HTTP, FTP, Gopher, and file protocols. You can extend these services or add a new service. Microsoft is adding more services to enhance the server support for the intranet Weblications. One such example is the "Viper." In the words of Microsoft, Viper Transaction Server is a "scalable application-partitioning and load-balancing component for flexible deployment and management of Weblications." |
In the following sections, you will see some of the Active Server component applications. They are all developed as components and can be activated anywhere in your network. As they are scalable, you can combine them in one application server or can have many application servers running the same component with load balancing and possibly content replication.
One of the good features of the Active Server framework is the data access capabilities. Figure 8.2 showed the various data access layers. Data access is through the ActiveX data objects, or ADO. The ADO helps you write the middle-layer business objects that implement your business rules.
In a sense, ADO objects follow the JDBC and ODBC data abstraction.
The first layer ADO object is the connection object,
which establishes and manages the interface with a database management
system. Once a connection is successfully established, you can
open a database and send a query. You can also call a stored procedure.
It is always more efficient to use stored procedures rather than
raw SQL statements. The recordset object handles the
execution and processing of SQL queries, parameters, and so on.
The result set is accessed in the script using the field
object, which has columns of data. The error object is
available to examine and find more details about any errors that
occurred during the database interaction.
Which technology is most suited for data access and publishing? |
As you can see, there are many ways of publishing data. How do you decide which one to use? From Microsoft materials, the following guidelines emerge as a first-line strategy: If you want to quickly publish existing data and don't know HTML, use the dbWeb to provide data access to your users. If you have existing Access forms, publish them with the Access 97 HTML Form Wizard. If you want to publish SQL Server data automatically, use SQL Server Web Assistant. If you want database publishing, the IDC is a suitable approach. But ... If you want high-performance dynamic, interactive database Web application, the Active Server Pages are the best choice. And ... If you are developing complex n-tier Web applications with sophisticated database interaction, you could be using the Advanced Data Connector, described in the next section. This gives you a general idea of the positioning of the various database access tools available from Microsoft. The above guidelines are true even if your database is Oracle, Approach, Sybase, or another similar database. Refer to Part II, Chapter 11, "Publishing Your Database on the Web," for some ideas on publishing your data through the Web. |
The Advanced Data Connector is aimed at complex n-tier Web applications that require cursor-level data manipulation and access to different types of live dynamic data in multiple databases. It is still in preliminary alpha stages. In the words of Microsoft, it "facilitates development of multi-tiered, data-centric applications."
The Advanced Data Connector is the component that you embed in your Web pages. It is a container for data-aware ActiveX controls. The ADC, with the higher level Advanced Data Namespace, manages recordsets that are rows of data. The Advanced Data Namespace manages database connections, SQL, and stored procedures. You can bind many ActiveX controls to one ADC.
The Web database application is developed by connecting these objects, through scripting, in the HTML page. You will be using the normal UI ActiveX controls for user interface.
Another component of the Active Server is the Information Retrieval system. This system is a combination of distributed search servers and index servers. A search server, or a collection of search servers, manages queries from clients and returns the results to clients. The search server is also called the Information Retrieval Web server because it is the HTTP front-end to the client browsers. Indexer servers usually are the back-end processors that index the contents. When you have multiple search servers, the indexes can be updated and kept current by the content replication process. The search and indexing functions can be run on a single machine or distributed across multiple machines dispersed geographically.
Currently, the transaction server, code-named "Viper," combines the worlds of transaction processing and component development. The transaction server component is an important part of the Active Server model for building mission-critical Internet and intranet servers. The transaction server aims at delivering reliable distribution and execution of the component architecture. For dynamic Web systems, with hundreds of users interacting with online databases, data consistency and reliability is a major issue. For electronic commerce and merchant servers to become successful, load balancing is a required feature.
Transaction servers provide features such as transaction coordination, multithreading, connection and context management, and data consistency.
Active Messaging is based on the Microsoft Exchange 5.0 and the
Internet Information Server 3.0. The Active Messaging components
are geared toward e-mail, discussions, team C&S (calendaring
and scheduling) including free-time search, information dissemination,
and so on. Active Messaging also borders on the groupware and
workflow applications like loan processing, sales force automation,
calendaring, or help desk and customer service.
NOTE |
The Active Messaging concepts are pursued by Lotus Notes and Netscape Communicator products, also. Even though they are not called Active Messaging, all these products have OLE capabilities, as well as workflow and messaging functionalities. They can co-exist with the Active Server applications as they support the OLE standard. |
ActiveEDI is not only a component, but it is an ActiveX technology-based system that will be of interest to corporate developers. EDI, or Electronic Data Interchange, is business-to-business communication technology. There are many systems available and now you can also use the ActiveX technology to develop EDI systems. The main components of ActiveEDI are the server-manager and the client-manager. The client-manager manages business rule events, data streams, and some GUI. The server-manager takes care of the data stream at the server-side. One innovative approach in the ActiveEDI architecture is the dynamic creation and management of business rules. Business rules can be tied to server or client events and can be developed and stored dynamically. This makes system development and maintenance easier. ActiveEDI also has error objects that can be programmatically manipulated by scripts.
If you are involved with EDI, you should keep an eye on the ActiveEDI as it develops.