Home Page ] [ Eiffel Archive ] [ Eiffel Classes and Clusters ]

Arc de Triomphe clipart (2486 bytes)CECGI v0.901

Written by Ted Lawson

cecgi_v0_901.tar.Z (23,920 bytes)


The CECGI classes are Copyright (c) 1996 by the University of Wales College of Cardiff.

This is the Shareware version of CECGI. You may use this software for a trial period of 45 days. If, after that time you wish to continue using it you must register with University of Wales College of Cardiff. CECGI registration costs GBP 10.00 (UK Sterling) or $20 (US dollars). See file LICENSE.TXT for more details.

Warning! This software comes with absolutely no warranty.

You may copy unregistered copies freely, in fact it is encouraged. However it must be distributed in an unmodified form, including *all* files. Permission from University of Wales College of Cardiff is required if you wish to distribute this software via non-electronic means. See file LICENSE.TXT for more details.

The CECGI Cluster

The CECGI Cluster is an Eiffel class library which allows CGI programs to be written entirely in Eiffel. CGI (Common Gateway Interface) programs are programs designed to be run as server applications for WWW browsers, such as Netscape. Each CGI program has a URL address, and gets invoked when a browser hits the address.

CGI programs have traditionally been written in conventional languages such as C or C++, or in Shell-like interpreted languages such as Perl. The CECGI library offers an alternative to these approaches and has two major advantages. Firstly, writing maintainable code in C, C++ or Perl is difficult, and so there is a significant risk that CGI programs couched in these languages will become burdensome legacy software before long. By enabling CGI programs to be written entirely in Eiffel, the CECGI cluster lets client-server developers exploit the very high degree of maintainability that the Eiffel language imparts. Secondly, facilities offered by the CECGI cluster help programmers solve a significant problem associated with practical CGI program design, the problem of state management.

State Management

When hit, a CGI program can accept a one-shot delivery of data from the browser, and can send a package of data back to the browser, usually in the form of dynamically generated HTML code for the browser to display. But no other kind of browser-CGI program interaction is possible. Each hit can be at most a single handshake.

If a CGI program needs to converse with the browser, as will be the case for most practical client-server applications, the conversation must take place across a series of hits. Then of course some or all of the state of the CGI program must be preserved between hits. But a number of factors make arranging this complicated, including, for example, the fact that the same CGI program can be invoked by several browsers concurrently. The CECGI cluster offers an elegant and transparent solution to the state management problem, as explained next.

Hit States

To solve the problem, the CECGI cluster offers facilities which allow a CGI program to transmit its state to a browser in a way that causes the state to be sent back to the CGI program when the browser next hits it, reinvoking the program in that state.

Suppose we call a CGI program state that is relayed between a CGI program and a browser, a "hit-state". There are three ways that a hit-state can be sent to the browser, stored and retransmitted back to the CGI program. It can be appended to a URL in a hyperlink, appended to a form action, or sent as a hidden field inside a form. The hit-state is returned to the CGI program either when the hyperlink is invoked (i.e. clicked on) or when the form is submitted.

Of course the hit-state of an Eiffel program will be an Eiffel object, and in most cases, it will be a complex object incorporating an arbitrary number of possibly complex supplier objects. The CECGI cluster can relay hit-states which are arbitrarily complex, subject only to certain server-imposed size limits.

This is a particularly transparent solution to the state management problem because the CGI programmer can then model the periods between hits simply as times when the CGI program is suspended, waiting for a reply from the browser.

Home Page ] [ Eiffel Archive ] [ Eiffel Classes and Clusters ]