Java Reference
In-Depth Information
works correctly in all of the target execution environments. This has certainly been
the case with many interactive Java applications. More importantly, Java applets are
restricted to a very stern security model that limits their functionality.
Client-side Java applications running outside of the browser, on the other hand,
are surprisingly portable. There are a number of class libraries available that define
powerful mechanisms to build graphical user interfaces (GUIs). Sun provides the
original Abstract Window Toolkit (AWT) libraries and the newer Java Foundation
Classes (JFC)/Swing class graphical libraries, which run on all platforms. Any of
these class libraries provide excellent mechanisms to build first-rate GUIs.
Another point to consider is that server-based Java applications are likely to be
less susceptible to these variations, and most business logic is server-based. The ma-
jority of the differences between Java runtime environments arise from user inter-
face issues. Since server applications don't have their own user interface, they are,
by and large, unaffected by most of the runtime environment differences. Server
applications will experience some variations in runtime environments, but these
variations are fairly technical in nature (such as the mechanism to use for access to
the native system), and normally they are easy to isolate.
Enough with the concepts. It's time to write some code. It's a good idea to mix
reading about concepts with working on those concepts.
In order to write programs in Java, you will need a few tools. At a minimum,
you will need a Java compiler, a JVM to interpret and execute your code, and a text
editor. The text editor can be one of your choice, from Notepad on Windows sys-
tems to vi in a UNIX environment. The only requirement is that it create vanilla
text files without any special formatting characters (such as a word processor might
put into a file).
If you are lucky (and smart), you will use an integrated development environ-
ment (IDE) from a Java tool vendor. IDEs combine compilers, JVMs, a nice editor,
and some type of project management tool into an integrated system. Sun and BEA
sell excellent graphical Java development environments. Eclipse, the open source IDE
project started by IBM, is used by most Java developers (www.sdtimes.com/
content/article.aspx?ArticleID=30020). I will discuss Eclipse in Chapter 17.
The IDE tools take full advantage of a graphical operating system, such as Win-
dows, Linux, and Solaris. These products take most of the grunt work out of the
development experience, and they allow you to focus more time on your program-
ming problem and less on tedious chores like managing files.
A popular nongraphical toolset is Sun's Java Software Development Kit (SDK),
which is part of its Java platform solution. The SDK includes a free Java compiler
and runtime environment and is available from Sun at www.java.sun.com. It is also
included on the CD-ROM. You can just download this to your PC and use it. Of
course, it doesn't have a graphical editor and is not a visually integrated develop-
ment environment, but you can't beat the price.
Search WWH ::




Custom Search