Java Reference
In-Depth Information
Given the similarity between Java and C#, one might naturally ask, “Will C# replace
Java?” The answer is No. Java and C# are optimized for two different types of computing
environments. Just as C++ and Java will coexist for a long time to come, so will C# and
Java.
Java's Contribution to the Internet
The Internet helped catapult Java to the forefront of programming, and Java, in turn, had
a profound effect on the Internet. In addition to simplifying web programming in general,
Java innovated a new type of networked program called the applet that changed the way
the online world thought about content. Java also addressed some of the thorniest issues as-
sociated with the Internet: portability and security. Let's look more closely at each of these.
Java Applets
An applet is a special kind of Java program that is designed to be transmitted over the Inter-
net and automatically executed by a Java-compatible web browser. Furthermore, an applet
is downloaded on demand, without further interaction with the user. If the user clicks a link
that contains an applet, the applet will be automatically downloaded and run in the browser.
Applets are intended to be small programs. They are typically used to display data provided
by the server, handle user input, or provide simple functions, such as a loan calculator, that
execute locally, rather than on the server. In essence, the applet allows some functionality
to be moved from the server to the client.
The creation of the applet changed Internet programming because it expanded the uni-
verse of objects that can move about freely in cyberspace. In general, there are two very
broad categories of objects that are transmitted between the server and the client: passive
information and dynamic, active programs. For example, when you read your e-mail, you
are viewing passive data. Even when you download a program, the program's code is still
only passive data until you execute it. By contrast, the applet is a dynamic, self-executing
program. Such a program is an active agent on the client computer, yet it is initiated by the
server.
As desirable as dynamic, networked programs are, they also present serious problems
in the areas of security and portability. Obviously, a program that downloads and executes
automatically on the client computer must be prevented from doing harm. It must also be
able to run in a variety of different environments and under different operating systems. As
you will see, Java solved these problems in an effective and elegant way. Let's look a bit
more closely at each.
Security
Search WWH ::




Custom Search