Navigator 3.0 is the most powerful version of Netscape's Web browser. Besides bringing together a collection of useful Internet-access tools, such as a mail client, a news reader, and improved support for the developing HTML 3 standard, Navigator 3.0 adds several features that enhance the ability of Web authors to develop complete, platform-independent applications deployed and executed in the Netscape browser. Going beyond the Web browser, Navigator Gold adds editing and development tools to the package.
These capabilities include an applications programmer's interface
(API) for plug-ins.
Although Netscape Navigator started out its life as a basic Web browser, as it has grown increasingly popular, it has become much more.
A quick look at the Netscape Web site shows that today's Navigator can do so much more than previous versions-even without special programming by Web developers. With freely available plug-ins from leading software companies, Web authors can include native CorelDRAW! graphics or Microsoft Word files in their documents, as well as view VRML (Virtual Reality Modeling Language) worlds, and view documents formatted in Adobe's device-independent Acrobat format.
On top of all this, Navigator provides several tools that Web page developers and authors can take advantage of to enhance their documents and add dynamic interaction with the information they provide on the Internet.
Frames are the most visually noticeable extension of HTML in Navigator 2.0 and 3.0. Using frames, authors are able to partition the screen into multiple rectangular sections. Each section is independent of all the others, and a different URL is loaded into each frame. In addition, links in one frame can be used to update another frame, without disturbing any others.
Frames are being used today to produce fixed, bannerlike mastheads for Web Pages, for menus that always stay on the screen and don't need to be reloaded or redrawn, and for forms-based searches where the form is always available.
In addition to the obvious visual appeal of frames technology, this extension to HTML may have an added benefit in that it reduces the amount of data that may need to be requested from the server and sent to clients. On the increasingly congested World Wide Web, this may prove to make Web browsing slightly more efficient and reduce some of the load on over-burdened Web servers.
Figure 1.1 shows an example of how frames can divide a screen and provide both a fixed masthead and a permanent menu next to several frames of dynamic information. Figure 1.2 shows how a menu selection updates a section of the screen.
Figure 1.1 : Using frames provides fixed and dynamic elements.
Figure 1.2 : Using a menu to update one frame.
By providing an open application programmer's interface for plug-ins, Netscape has made it possible for third-party software vendors to provide the ability to view a wide range of data and documents in the Navigator browser window. Netscape refers to objects displayed by plug-ins as Live Objects.
Figure 1.3 : Paper Software's WebFX plug-in enable Navigator 2.0 to browse VRML worlds.
The number of available plug-ins is constantly changing. Netscape provides an up-to-date list of available plug-ins at this site:
Some of the common Java applets available today include the following:
Figure 1.4 : This Web page demo by Sun Microsystems 'Jim Graham user Java to include live data feeds.
The widespread popularity of Java means that the range of uses will increase in the future, but today Java is being used primarily for cosmetic enhancements to Web pages.
Java is much more than a language for developing Web-based applications. It is designed to compete in a market of full-fledged, general-purpose programming languages such as C, C++, Pascal, and FORTRAN. Unlike its predecessors, Java's claims to fame include the fact that it is platform-independent and that it can be used for both applications development and the development of in-line applets, or small applications, for Web pages.
Like C++ and Smalltalk, Java is object-oriented and relies heavily on the syntax and style of C++. With this comes the steep learning curve of a high-end object-oriented programming language.
Unlike most other general-purpose programming languages, Java is not compiled in the traditional sense. Instead of compiling to native machine code, the Java compiler converts source code into Java byte codes (known as architecture-neutral byte-codes)-a platform-independent representation of the Java program code-which are then run on a machine-dependent runtime interpreter. In this way, developers only need to develop and maintain one set of source code and compile it once, and the code can then be run using the runtime interpreters for any machine.
Like all compiled languages, though, this adds the complexity of a compilation cycle to development and especially to debugging. However, to a certain degree like other compiled languages, an efficient runtime engine means that Java should offer better performance than general-purpose, interpreted scripting languages.
A fundamental feature of true object-oriented languages is that
they are extensible. That is, programmers can create their own
classes-or groupings of objects and data structures-to extend
the basic classes that are part of the programming languages.
A class is a term used in object-oriented programming to refer to a set of related objects that share common characteristics. Classes, and the ability to create new classes, are what make object-oriented programming a powerful and flexible programming model.
Java is no exception to this rule. Java programmers routinely create their own extensions to the base set of tools or classes.
As mentioned before, object-oriented programming languages tend to have steep learning curves, especially for nonprogrammers. Java is not exempt from this difficulty.
The general consensus among beginning programmers is that learning Java is a formidable task, especially considering the complexity of the available on-line documentation on the Internet.
The base set of classes that comes with the Java distribution make it ideally suited to client-server interactions. The ability to work with URLs and talk to HTTP servers already exists. The support for applets adds the ability to interact with user events in the client Web browser.
In addition, HotJava, the demonstration browser from Sun Microsystems,
demonstrates how Java can become the means by which browsers dynamically
learn to handle new protocols as that ability is needed.
Sun developed HotJava when Java was still in alpha development to demonstrate the potential of Java for distributed applications on the World Wide Web and to show how browsers could dynamically learn to handle new protocols and file types. HotJava is available for Solaris and 32-bit Windows (Windows NT and Windows 95) from the Java home page at http://www.javasoft.com/.
Java is famous because it can be used to develop applets that are delivered on the World Wide Web and executed in client Web browsers. However, Java can also be used to develop complete, platform-independent GUI applications using the Java runtime interpreter.
Because of the extremely open and public nature of the World Wide Web, security is a major issue for Java and Java applets. After all, allowing application code from unknown remote machines to be downloaded and executed on your computer system is potentially dangerous. Not only is there potential for applets to contain viruses, but they could simply be malicious applications intent on destroying your data and rendering your computer inoperable.
To address this, Sun implemented tight security features from the earliest stages of Java development. These features include verification of bytecodes (to ensure they don't violate access restrictions and more), as well as configurable network security that ranges from disabling network access to limiting access by an applet only to the host where the code originated, all the way to completely free network access.
There have been reports of security holes in the Java environment, but both Sun and Netscape have been responsive to these reports and concerns. With each release of Java, security should be improved.
Even though applets are a feature of the World Wide Web and are included as in-line applets in HTML files, they are distinct and separate from HTML and HTML files. New HTML tags force a Web browser to initiate a new connection to the server and tell the browser where to display the applet's output on the Web page, but beyond that, applets are separate and distinct from HTML.
While users can create their own objects and write functions, this is not the same as the classes and inheritance offered in Java and other object-oriented programming languages.
Essentially, this endorsement from Sun breathed life into a scripting language that very few people were paying attention to, but which is now the hot topic on the World Wide Web.
Scripting languages have been in use long before the Web came around. In the UNIX environment, scripts have been used to perform repetitive system administration tasks and to automate many tasks for less computer-literate users. In addition, scripting languages are the basis of much of the CGI-BIN programming that is currently used to add a limited form of interactivity to Web pages.
This adds interactivity to Web pages, makes forms dynamic, and can decrease the bandwidth requirements and server load incurred by using forms and CGI programming.
Fundamentally, objects are a way of organizing information, along with the methods for manipulating and using that information.
Objects provide a way to define specific pieces of data related to the item in question; these pieces are known as properties. In addition, these are supplemented by tasks that can be performed on or with that information, known as methods. Together properties and methods make up objects.
Because of the general nature of objects, specific instances can be created for each case where they are needed. For instance, a car object could then have several instances for Toyotas, Fords, and Volkswagens.
Defining objects in this way differs greatly from the way in which information is handled in traditional procedural programming languages such as FORTRAN and C.
In these languages, information and procedures (similar to methods) are kept separate and distinct and are not linked in the way that objects are. Also, the concept of creating instances isn't as well developed in procedural languages.
|window||The window object provides methods and properties for dealing with the actual Navigator window, including objects for each frame.|
|location||The location object provides properties and methods for working with the currently open URL.|
|history||The history object provides information about the history list and enables limited interaction with the list.|
|document||The document object is one of the most heavily used objects in the hierarchy. It contains objects, properties, and methods for working with document elements including forms, links, anchors, and with applets.|
In addition to the objects in the Navigator Object Hierarchy,
current windows or loaded documents. Table 1.2 outlines the major
features of these objects.
|string||The string object enables programs to work with and manipulate strings of text, including extracting substrings and converting text to upper- or lowercase characters.|
|Math||The Math object provides methods to perform trigonometric functions, such as sine and tangent, as well as general mathematical functions, such as square roots.|
|Date||With the Date object, programs can work with the current date or create instances for specific dates. The object includes methods for calculating the difference between two dates and working with times.|
Properties are like variables in traditional languages, such as C and Pascal. Variables are named containers which are used to hold pieces of data, such as numbers or text. Variables are discussed in more detail in Chapter 3, "Working with Data and Information."
Of course, having this information isn't worth much without ways to use the information. For instance, in this example, you want to be able to print out a nicely formatted description of the aircraft or be able to calculate the maximum distance the plane can travel based on the fuel capacity.
In object-oriented terminology, these tasks are known as methods. Like properties, your methods might be referred to as:
Objects can also include other objects in much the same way as properties and methods. For instance, the airplane manufacturer may want to include an object inside his object definition to handle information about the number of planes in use worldwide, who is using them, and their safety records. This information, along with methods for working with the information, could be combined into an object called airplane.record. This object could then include properties and methods such as:
What you have created is a general description of an object that
defines the information you want to work with and the ways you
want to work with it. These general descriptions of objects are
known as classes. In object-oriented programming, then, you can
create specific instances of the class as needed.
For instance, in this example, the airplane manufacturer might want to create an instance of the airplane object for its newest aircraft, the SuperPlane. If this instance were created, then a program could assign specific values to the properties of the new instance by referring to superplane.price, superplane.model, and so on. Likewise, a description of the new plane could be printed out using superplane.description().
Most well-developed programming environments include a suite of tools that make development easier and simplify and speed up the debugging process.