3. Computers, Objects, and Java

3.4. Networks, the Internet and the World Wide Web

Most personal computers contain software that enables them to be con- nected to various-sized networks of computers. Networks allow many in- dividual users to share costly computer resources, such as a high-speed printer or a large disk drive or application server that is used to store and distribute both data and programs to the computers on the network. Net- works can range in size from local area networks (LANs), which connect computers and peripherals over a relatively small area, such as within a lab or a building, through wide area networks (WANs), which can span large geographic areas, such as cities and nations.

Client/server computingApplication servers are just one example of client/server computing, a

computing approach made possible by networks. According to this ap- proach, certain computers on the network are set up as servers, which pro- vide certain well-defined services to client computers. For example, one computer in a network may be set up as the email server, with the responsi-

 

SECTION 0.3 Networks, the Internet and the World Wide Web 5

bility of sending, receiving, and storing mail for all users on the network. To access their email on the email server, individual users employ client application software that resides on their desktop computers, such as Out- look Express or Eudora or Pine. Similarly, another server may be set up as a Web server, with the responsibility of storing and serving up Web pages for all the users on the network. Users can run Web browsers, another type of client software, to access Web pages on the server. Java is particularly well suited for these types of networked or distributed applications, where part of the application software resides on a server and part resides on the client computer.

The Internet (with a capital I) is a network of networks whose geo- graphical area covers the entire globe. The World Wide Web (WWW) is another example of distributed, client/server computing. The WWW is not a separate physical network. Rather it is a subset of the Internet that uses the HyperText Transfer Protocol (HTTP). A protocol is a set of rules and conventions that govern how communication takes place between two computers. HTTP is a multimedia protocol, which means that it supports the transmission of text, graphics, sound, and other forms of information. Certain computers within a network run special software that enables them to play the role of HTTP (or Web) servers. They store Web documents and are capable of handling requests for documents from client browser applications. The servers and clients can be located anywhere on the Internet.

The documents stored on Web servers are encoded in a special text- based language known as HyperText Markup Language, or HTML. Web browsers, such as Netscape’s Navigator and Microsoft’s Internet Explorer, are designed to interpret documents coded in this language. The language itself is very simple. Its basic elements are known as tags, which consist of certain keywords or other text contained within angle brackets, < and

>. For example, if you wanted to italicize text on a Web page, you would enclose it between the < I > and < /I > tags. Thus, the following HTML code

,,

 

J

would be displayed by the Web browser as

Italic font can be used for emphasis.

When you use a Web browser to surf the Internet, you repeatedly instruct your browser to go to a certain location and retrieve a page that is encoded in HTML. For example, if you typed the following URL (Uniform Resource Locator)

,

 

J

into your browser, the browser would send a message to the Web server www located in the prenhall.com domain—the prenhall portion of this address specifies Prentice Hall and the com portion specifies the com- mercial domain of the Internet—requesting that the document named index.html in the morelli directory be retrieved and sent back to your

 

Figure 2: WWW: The client’s browser requests a page from a Web server. When the HTML doc- ument is returned, it is interpreted and displayed by the browser.

 

 

 

 

 

 

Client

 

 

computer (Fig. 2). The beauty of the Web is that it is possible to embed text, sound, video, and graphics within an HTML document, making it possible to download a wide range of multimedia resources through this (relatively) simple mechanism.

The Web has begun to change business, entertainment, commerce, and education. The fact that it is possible to download computer games and other application software from the Web is changing the way software and other digital products are purchased and distributed. Similarly, as noted earlier, many businesses have begun to organize their information systems into intranets—private networks that implement the HTTP protocol. Cur- rently, one of the biggest areas of development on the Web is commerce. As consumers become more comfortable that credit-card information can be securely transmitted over the Web (as it can over a telephone), the Web will explode as a marketing medium as powerful, perhaps, as television is today. Because Java has been designed to support secure, distributed, networked applications, it is ideally suited to be used as the language for these types of applications.