Developing Internet ApplicationsNext

Chapter 1: Overview of Internet Programming

This chapter explains what is meant by an Internet application, and what its different components are.

1.1 Overview

An Internet application is a client/server application that uses standard Internet protocols for connecting the client to the server. You can use exactly the same techniques to create a true Internet application, which is available publicly through the World Wide Web, or to create an intranet application. An intranet application is one that runs on your corporate intranet, and is only available to the staff in your corporation. Whenever we talk about Internet applications, we mean either true Internet applications or intranet applications. For an introduction to the World Wide Web, see the appendix Introduction to the World Wide Web.

Internet applications are thin-client, thick-server. This means that the client end, the part the end-user sees and interacts with, is only responsible for the user interface. The client runs on a Web browser - the standard tool for accessing the Internet. All the processing is done at the server end - where your corporate data is.

Because your applications use standard Internet protocols for client/server communications, you can make your applications cross-platform. The server-side programs are written in Micro Focus COBOL, and so you can run them on Windows NT or UNIX servers (you need to purchase Micro Focus COBOL for UNIX to run applications on UNIX).

The server-side program for an Internet application communicates with the client through the Web server software for the machine. The interface between a COBOL program and the Web server running it is transparent to the programmer, and you can use any of the three industry-standard Web server interfaces without code changes:

These are explained in more detail in the chapter CGI, ISAPI and NSAPI Programs. Using the Net Express Internet Application Wizard, you can select whether to build applications for use with CGI (supported by all Web servers) or ISAPI (optimized for Microsoft IIS). We recommend carrying out development and debugging using CGI. You can convert any COBOL CGI program to ISAPI or NSAPI subsequently by changing Net Express compiler and build settings, and rebuilding the program.

The client-side user interface can be written using any mix of the following:

For more information, see the chapter Forms and HTML.

Form Designer also enables easy scripting to add extra client-side functionality. You can carry out common validation functions (see the chapter Form Validation), or add your own scripts with the help of the Script Assistant (see the chapter Client-side Programming).

1.2 What does an Internet Application Look Like?

Internet applications are client/server applications, and can be split into two pieces:

The form is the part your end-user sees. It is displayed in a Web browser, and provides controls by which your end-user can enter data. The picture below shows you a sample form:



Figure 1-1: A sample form for an Internet Application

When the end-user clicks the Send Form button, the information on the form is packaged up, and sent to a server-side program. The server-side program only runs when it is started from a form, or from a link on a Web page. The server-side program processes the information on the form, and returns a page to the end-user.

Depending on what the program does, the result is displayed on a form on the page returned, or perhaps as text.

1.2.1 More Complex Applications

The example above is very simple. Real applications are likely to be more complex, and could consist of several forms and server-side programs linked together. We have categorized server-side programs into two types:

Asymmetric server-side programs enable you to build up complex applications by chaining together different forms and server-side programs. The diagram below shows an application where the output from the first program starts a second server-side program. The second program outputs different forms depending on its processing path.



Figure 1-4: A more complex application


Note:

Web browsers display HTML pages. An HTML page can contain one or more forms. A server-side program can only receive input from a single form. The server-side program returns a page to the browser, which can also contain one or more forms.

The basic unit of input to a server-side program is always a form, and the basic unit of output is always a page. But most pages only contain a single form, and since most of your focus when you are creating applications is on forms rather than pages, the diagrams only show pages.


1.3 Execution Flow

Internet applications have the flavor of traditional CICS applications. If you think of the form as a BMS input screen, and a CICS transaction as the server-side program, then the flow of control is very similar. Like a CICS transaction, a server-side program only runs for long enough to process some data and return a result. A complex CICS application consists of several input screens, and several transactions. The end-user has the illusion that the application is running all the time, when the application consists of a series of transactions which run for a short time and then disappear.

An application based on a symmetric server-side program (see the previous section for an explanation of this term) works like this:

  1. An end-user clicks a link on a Web page which starts a server-side program running.

  2. The server-side program runs, and sends back an HTML page, containing a form for the application.

  3. The end-user fills in the form and clicks a button to submit it.

    This runs the server-side program again.

  4. The server-side program fetches some data, and returns it to the end-user's browser in the form.

There are many possible variations on the above sequence. For example, the sample CGI application supplied with Net Express (in Net Express\base\demo\cgi\cgiprg1.app) starts with an input form, that executes a CGI program that returns a simple HTML page. The types of asymmetric server-side program discussed briefly in the previous section may be a good deal more complex, but the essential point is that server-side programs only run long enough to return a result.


Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

Developing Internet ApplicationsNext