|Developing Internet Applications|
This chapter explains what is meant by an Internet application, and what its different components are.
An Internet application is a client/server application which 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 which 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. By default, all applications created with NetExpress are built for use with CGI (supported by all Web servers), and we recommend carrying out development and debugging using CGI. You can convert any COBOL CGI program to ISAPI or NSAPI by changing NetExpress 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).
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.
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:
A symmetric server-side program uses the same form for input and output. For example, a database query/update program presents you with a set of fields for a record or a SQL query. You use the same fields to enter data to query the database, as the program uses to return you the result.
Figure 1-2: A symmetric server-side program
An asymmetric server-side program uses a different form for input and output. For example, an order entry program which uses one form for you to enter the customer details, and then displays a second form on which you enter a new order.
Figure 1-3: An asymmetric server-side program
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
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.
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:
This runs the server-side program again.
There are many possible variations on the above sequence. For example, the sample CGI application supplied with NetExpress (in netexpress\base\demo\cgi\cgiprg1.app) starts with an input form, which 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 © 1998 Micro Focus Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
|Developing Internet Applications|