Introduction

Welcome to World Wide Web Programming. WWWP represents a new concept in education and educational materials. It includes two major components: an on-line course and this printed text.

The on-line course takes advantage of the Internet, the World Wide Web, and Java to provide the instructor and the student with up-to-date materials that are revised as the technology changes, dynamic examples that can be run in class, and active tools to help with communication and finding information.

The printed text supplements the on-line course and provides discussions of concepts that would be tiring to read on-line. It also includes frequently used reference information.

Thus, the WWWP package represents the best of both worlds. It uses print and electronic media in complementary ways, so that information is presented in the most appropriate and easy to use form for a particular purpose.


Concept

The course is based on two main ideas. First, Java and the World Wide Web comprise a new general-purpose computing environment. Thus, the primary goal of this course is to prepare students to write programs for and within this environment.

Second, the course is intended to be conducted primarily through the Internet and the World Wide Web. Much of the course content will be presented through a Web browser; students will present their programming assignments and class projects as Web pages; and a variety of network tools will be available to encourage student-student, student-instructor, and student-content interaction.

Computing Environment

The nature of computing has gone through several cycles of development over the past forty years. Changes in hardware lead to changes in software which, in turn, lead to changes in users' behavior and expectations, providing incentive for further hardware development, etc. Three of these cycles are discussed here along with the specific changes in users' behavior and expectations that have resulted.

History

During the past forty years, computing has gone through three major epochs from the user's point of view. The first computers were, of course, mainframes. These behemoths were locked away in secure areas and were accessible to very small groups of users. When they first appeared, access was usually provided through decks of cards submitted over a counter to a technician who, in turn, loaded them into a card reader for input to the computer and eventual processing. By the early 1970s, access had been extended to terminals wired directly to the mainframe or indirectly through modems and telephone lines. Under both modes of access, programs tended to be batch-oriented. The programmer thought in terms of setting-up a process, inputting data to that process, running the process to completion, and then terminating it; while the process ran, it often produced voluminous printed output intended to be read "off-line." Typical programs included payroll, sorting, and database applications.

The second epoch was marked by the appearance of microcomputers and workstations in the early 1980s. Unlike mainframes, micros were intended to be used continuously by a single user for long periods of time. Consequently, a different type of software appeared. Instead of batch jobs that ran to completion, microcomputer software emphasized the graphic user interface and continuous execution. Processing often took place in cycles as the program awaited input from the user and then processed it according to instructions entered through the interface. Typical microcomputer programs include word processing, spreadsheets, and games.

The current epoch began in the early 1990s. Its distinguishing characteristic is its orientation toward the network. It was enabled by the rapid growth of the Internet and the appearance of the World Wide Web. The latter made the network accessible to the general public. Had development stopped there, we would have had a new infrastructure for business, education, entertainment, etc. It would have led to new services and to new, specialized software, such as CGI applications, to support those services. But it would not have comprised a new, general purpose computing environment. What tipped the scales in that direction was Java.

From one perspective, Java is just another programming language. If the emphasis is placed on Java applications, there is not a great deal of difference between a Java program and a Pascal, C++, or SmallTalk program, except for platform independence and better network support. But if the emphasis is placed on applets, the result is something altogether different. These programs can be -- indeed, are intended to be -- delivered on demand over the network to a Web browser. They can interact, albeit in a limited way, with that browser, and they can interact with other processes throughout the network, after first connecting to a process running on the platform from which the applet was originally accessed.

A general infrastructure is emerging that combines the Internet, the World Wide Web, and Java.

Change the Context, Change the Behavior

Because communication in various forms can be provided through the network, many programs currently include (or will soon include) a communication component. This, in turn, will lead to software that routinely can be used both in a stand-alone mode and in a collaborative mode in which several users, geographically distributed, work together on the same artifact. With routine access to the network, software developers are likely to place more emphasis in their designs on developing layers of support packages that can be reused by others as well as themselves; thus, sharing components under a variety of financial arrangements may become more frequent.

The Web browser, or whatever it is that we call the browser in the future, will play an increasingly important role in this environment. Rather than functioning as a network application, it is likely to appear more and more as the interface to "the system." It will provide access to data, analogous to the interface to the file system provided by conventional operating system interfaces. It will provide integration for multiple Java applets running concurrently. And it will provide the interface for an increasing number of network services, such as e-mail, forums, and chatrooms. It is the author's belief that network applications not accessible through a browser will be at a significant disadvantage versus those that are. Similarly, standalone Internet applications will lose out in the long-term to services provided through on-demand Java applets and servers that are accessable through a Web browser.

Thus, as more and more software includes network services, more and more users will expect these services in all software. Consequently, network-oriented programs will become the norm. In the future, when we think of "general-purpose" software, we will think of software that includes network functions.

Computing Within the Internet/WWW/Java Context

The current epoch of computing, described above, is still in the process of being born. But its general shape and its potential can already be seen. This course in Java and WWW Programming is shaped by this perspective. It emphasizes Java applets rather than Java applications. It describes the client/server architecture and discusses the network resources needed to build simple client/server applications. It describes the Web's Common Gateway Interface (CGI) in detail and includes an introduction to Perl, the language of choice for CGI applications.

Thus, it prepares students to begin programming within a network context and encourages them to think about what computing is likely to become in the future. Students and instructors do not have to subscribe fully to this perspective in order to use the course materials, but the course will make more sense to them if they understand the concepts that underlie it.

Web-Based Course

The second major concept underlying this course is that it is intended to be Web-based. This assumption applies to course content, student work, and to a collection of on-line tools.

Course Content

The majority of the course content will be delivered through the Web. This includes materials used by the instructor during his or her lectures, materials read by students out of class, and the various administrative documents, such as course description, grading policy, and schedule, that would normally be "handed out" in paper form. Selections from this printed text will also be included in the on-line materials for fast lookup and reference, but they are not intended to be read in their entirety in that format.

Student Work

The class can be structured so that students have a homepage for their course-related work. Each assignment can then be presented through the student's homepage. These presentations typically include a description of the program or project, the source code, and an anchor that can be invoked to run the program. At the end of the semester, the homepage constitutes a portfolio for the semester's work.

On-Line Tools

An integral part of the course is an evolving set of on-line tools that will normally be accessible through the course homepage. Those currently included are course-related forums, chatrooms, and a search engine.

Forums enable students to pose questions on course-related topics. They may be answered by the instructor or teaching assistant, but in many cases students answer one another's questions. Thus, over the semester forums can become a cache for the group's shared knowledge.

Course-related chatrooms provide some of the same functions as forums but in real time. Thus, if a student is working late at night and has a question, he or she may find a colleague who has the answer listening in on the class chatroom.

A search engine can be run in conjunction with the class. It indexes all or selected course files. Thereafter, participants may search for a keyword or phrase and quickly find the pages in the class materials that include the search term(s).

Additional tools will be added as they become available and as they prove useful.

Printed Text

It is tempting with an on-line course to include all course content in Web format, and, indeed, we have included a number of segments from the book in that form. However, many readers find it tiring to read long passages of text on-line. In addition to eye strain, some find it more difficult to absorb abstract ideas from the screen than from the page, where they can mark key phrases, jot down comments, and easily move back and forth from one section to another. Consequently, the author and the editors view this printed text as an important and integral part of the overall course material.

The book includes four sections. In the first, background concepts are introduced. These include the history and architecture of the Internet, the architecture of the World Wide Web, and an overview of the latter's Common Gateway Interface (CGI).

In the second, the Perl programming language is introduced. After a brief history, features are discussed that have made it the language of choice for CGI applications.

In the third and largest section, a dozen or so topics that underlie Java program constructs are discussed. These range from an overview of object-oriented programs to threads and the client/server model of program design.

The fourth section is appendices. They include the API for frequently used Java packages, an index of classes and their variables and methods, and a general index for the book.

One of the advantages of the on-line world is communication. Please send us your comments and suggestions as you read the book, either through the link to the author's e-mail address included in the on-line course or directly: jbs@cs.unc.edu.

Thanks.