Sunday, May 17, 2009

Final Question # 1

1.Twice each year, the New Hampshire Department of Education requires school districts to complete the personnel form featured in this report. Thus the task of our Web-based example is to illustrate how the data could be gathered from different locations, collected and stored centrally, made available to users with appropriate permissions at different locations, and made unavailable to users not possessing these permissions. In presenting the example in the form of an electronic report, we include not only an explanation of the data collection system, but an opportunity for readers to actually use the system: by clicking on appropriate links and buttons the reader will be able to interact with the software and the sample database located on the STG Web server.

The system explained and demonstrated here consists, on the server side, of several specialized CGI scripts and a simple, generic DBM database. The system encountered by the user, however, consists only of HTML pages and forms. This makes it possible for users to intract with the system from any computer capable of running a Web browser (e.g., Netscape, Internet Explorer or Lynx).

The programs facilitating the interactive forms are all implemented as CGI scripts, written in the popular programming language called PERL. [6] These scripts are small and easily produced, and the system is generic in the sense that it can be easily customized to suit the individual data collection, authentication, and reporting needs of any school department in the NetTech region.

Although it would have been possible to use a large, commercial database package to house data from our forms, we felt it was important to show this was unnecessary. All that is required here is the ability to associate keys with values; in our example the keys were a combination of the year, the district, and a location in the input form. The values were just that: values typed into the input form at the given locations by a user. For example, key = "1997:District-10:f1a", value = "145", means "for the year 1997 in district 10, the value given for field 1a in the input form was 145".

Normally, a set of key-value associations are implemented by programmers using objects called hash tables. Hash tables, however, only stay in memory as long at a program is running. Our system clearly required something that would hold our data on disk for subsequent program runs. What we needed, in other words, was a persistent hash table.

Fortunately, most PERL installations have a set of simple, fast, hash-like routines known as DBM routines. These are elementary, generic database routines capable of storing key/value combinations in the manner of a hash table, and of doing it on-disk, rather than in volatile memory, so that the data could be accessed and modified on subsequent runs.

Similarly, the functions of DBM routines can be duplicated by any commercial database. As a result, if a district wants to import its data at the end of a given recording period into a larger commercial database, or into desktop spreadsheet programs, all it requires is a few lines of additional PERL code. PERL, fortunately, has modules for outputting files in most major database formats.

No comments:

Post a Comment