As with general
science and engineering, Java offers a number of benefits
in physics computations and also some shortcomings.
The graphical capabilities of Java provide great flexibility and
a wide array of tools for implementing simulations. Such
graphical simulations can often illustrate a phenomena far more
clearly than just by studying the underlying equations.
The portability of Java code allows theorists who collaborate
but work on different platforms to easily share code.
programs in Fortran and
C can benefit from attaching a Java graphical interface and also
by using Java's networking capabilities. Most of these legacy programs,
especially those involving extensive numerical computation programs,
represent huge numbers of person-hours of work and will never be
rewritten from scratch in another language. However, by giving them
a Java interface, their usability and accessibility vastly increases.
(Chapters 16-20 will
discuss how to use Java to interface to a legacy computational engine
over the web.)
Experimentalists often work on hardware
systems that include a wide range of platforms: Linux workstations,
MSWindows PCs, embedded processors in remote sensors, etc. Using
programs that can run on all of these platforms can greatly simplify
Here, as well, experimentalists can build networking programs with
Java that allow distributed sensors to share data, allow for remote
diagnostics and calibrations, monitoring of data as it is recorded,
and so forth. In Chapter
23 we will focus on embedded Java.
Until recently the lack of an official real-time specification
slowed the development and broad use of Java real time JVMs in many
data taking systems. Java in real-time applications have linked
with native code
(see Chapter 21) to carryout real-time operations. Now, however,
an official specification has been agreed upon and we can expect
to see a number of real time JVM's become available, especially
for small footprint, embedded platforms.
The lack of a 2-D array, array index checking, and no complex primitive
type are inherent shortcomings in Java that can seriously affect
some highly computationally intensive computations. However, in
such cases, Java can still provide a powerful interface to a numerical
module written in C or Fortran.
Similarly, linking to C or Fortran might overcome the general problem
of slow performance in the JVM. However, this problem has become
less acute with the development of sophisticated optimizing compilers
that transform Java bytecodes to native machine code. With such
compilers, it's possible that some Java programs can run even faster
than similar code in C or Fortran.
Latest update: Dec.10.2003