JAVA - 'the' language
The FirstPerson team should be proud of themselves
in achieving something that was thought unattainable; a small, simple,
robust, architecturally independent, and object oriented programming language;
the now-famous JAVA. The original intention
to enable the transfer of information over cheap infrared and packet-based
networks has turned out to be an ultimate programming language that can
run regardless of the specifications of any
particular machine, and capture the world wide attention especially those
whose lives are a part of the WWW or the
Internet. Now, already a world wide phenomenon, JAVA
boasts an environment rich enough to support entirely new kinds of applications
which are safe enough to be transferred throughout the Web
and powerful enough to replace native executable
codes. In short, JAVA supplies us with
a fast, portable, secure, and platform-independent software, hence opening
the opportunity for intelligent applications that can roam the Net
for us. Hurrah!
Introducing
: JAVA
As a curious mixture of C++
and Smalltalk, JAVA
is easy to learn; it has the syntax of C++ ,
yet small and easy. It has, however, improved C++
in some important areas; especially in those features that make
C++ unsafe and difficult to write/read. The platform - independency
which C++ does not share a common feature
with JAVA, and the automatic garbage collection
are among the other modifications.
General feature of
JAVA
Okay, let's breeze through the features of JAVA:
-
Automatic Garbage Collection
- Used to remove objects that are no longer needed. It's usually a low
priority thread; it reclaims an object when all references to an object
is gone, and returns the space to the available
pool of resources.
-
Reference - Java
use references instead of pointers, which is an abstract identifier for
an object. A reference tags a particular object with a name in the Java
virtual machine (JVM), so that the programmer may refer to it.
-
Interface - Java
doesn't support multiple inheritance. Therefore interfaces (a special kind
of class) are used instead, which are unique to the language, and play
a role similar to that of multiple inheritance in other object-oriented
languages.
-
Multi thread -
Quite similar to multi-processing, in multi-threading all execution contexts
share the same memory; this makes sharing data between threads simpler
than sharing data between processes.
-
Packages - Used
for managing namespaces, it can be thought of as a container
for related classes and interfaces (JAVA standard
library was divided into packages).
-
Exception handling
- JAVA uses exceptions (like interrupts)
to provide error handling capabilities for its programs. When an error
occurs within a JAVA program, it creates an
exception object and hands it to the run-time system.
-
Also, JAVA is strong-typed,
small, and simple (you can say that
again!).
Advantages of JAVA
The special features of JAVA
that give it quite an advantage over other languages are as follows:
-
Portable - Java
was designed to be both portable in its source form
and also in its compiled binary form. Note
that we need the JAVA virtual machine and
a few native libraries installed to the system
in order to achieve this. This is just a minor setback compared to the
portability that we would achieved.
-
Robust - The Java
code is well behaved and sturdy, promising extra protection.
-
Secure and reliable
- Java uses both compile-time
and run-time checking to ensure reliability.
The Java environment protects the client against
both intentional and unintentional attacks; against any viruses and worms
. Also, by removing the pointers from the memory management model, many
common program errors are eliminated.
-
Object-oriented
- It allows inheritance and reuse of code both in static and dynamic fashion,
hence a better organisation of programs.
-
High performance
- It supports several high performance features such as multi-threading.
-
Easy - It is similar
to C and C++, and small, hence easier to write,
debug, edit,
and compile. Also, by keeping the language
small, programmer have fewer chances to make mistakes that are difficult
to fix. Finally, the automatic garbage collection
just makes JAVA programs even easier
to handle.
Compiling JAVA programs
JAVA avoids the complications to recompile a program on different
machines and end up with multiple executable programs for multiple systems
(which is expensive in time and compilers) by having the JAVA
compiler and JAVA Virtual Machine.
Unlike any traditional compiling techniques, JAVA
compiler compiles the platform independent
source codes into platform independent JAVA
bytecodes (Note the platform - independency at both
levels!). These bytecodes look a lot like native codes, only that
they are not specific to any particular machine. The bytecodes are in turn
interpreted and then run by the JAVA Virtual Machine
or JAVA interpreter.


From this we can see, JAVA gives a compiled
program that is not specific to any system, and therefore can be run by
any processor, provided that the JAVA Virtual machine
is installed in that system (together with a few
native libraries). One of the advantages of performing this is that
we'll end up with only one executable program
that is platform-independent and thus economical and efficient in terms
of compilers and program codes. However there is one major drawback of
having the JAVA Virtual Machine. Interpreters
are, by their very nature slow. System-specific programs run directly on
the hardware they are compiled, so they run significantly faster than JAVA
bytecodes which must be processed by the interpreter. To overcome
this problem, a solution is to have a special tool (called just-in-time
or JIT compilers) to convert our JAVA bytecodes
into native code and speed up their execution. Yet, JIT
does not really eliminate this problem. JIT
may speed up any CPU-bound computations, especially in loops, but not the
screen paints, because they are typically limited by the speed of the graphics
adapter and not by anything happening in the computer's CPU. Nevertheless,
by using JIT does generally overcome the speed
problem of the JAVA Virtual Machine.
Portability of JAVA
Being architecturally neutral enables JAVA
to overcome the portability problem. This avoids the costly recompiling
and the re-written of expensive softwares
in order to accommodate programs to specific systems. In the present personal
computer market, application writers have to produce versions of their
application that are compatible with the IBM PC
and with the Apple Macintosh. With the PC
market (through Windows/NT) diversifying into
many CPU architectures, and Apple moving off
the 68000 towards the PowerPC, this makes
the production of software that runs on all platforms almost impossible.
This problem no longer exist thanks to JAVA,
as the same version of the applications can now run on all machines.
JAVA in the WWW
The World Wide Web is composed of networks,
which in turn, are composed of a variety of systems with a variety of
CPU and operating system architectures,
with some servers. To enable an application to execute anywhere in the
networks, we have to ensure that the applications is architecturely
- neutral. JAVA is the perfect answer.
Now programmers can rest at ease knowing any programs they write can be
run without difficulties, free of any specific architecture. Even better,
JAVA programs and applets, using bytecodes
which is smaller than native codes, can be
downloaded with even less times. Also being robust
and secure, we can rely on JAVA
to be safe against intentional or accidental attack on our systems by misbehaving
applets. Not to mention the security JAVA provide
to the servers; JAVA allows programs to run
on the client system, rather than being dependent on the server, which
resulted in prevention of the server from crashing in the case of error,
as well as avoiding network congestion, giving
a much faster result on applications.
JAVA development environment
For developing in a JAVA environment, we need
a platform-neutral, component architecture for JAVA;
to develop or assemble network-aware solutions for heterogeneous hardware
and operating system environments - within the enterprise or across the
Internet (with reliable and efficient compiler,
development and debugging tools). There are several choices in the present
market :
-
Javasoft's JavaBeans
- An effective tool to build a simple JAVA applet
by assembling a bunch of Beans without doing any programming (what a waste!).
One of the advantages of the JavaBeans architecture
is how easy is to instantiate Beans, be it inside another Bean, or in some
application or Applet.
-
Semantec's Cafe
- a standalone, Java development environment tool, mainly for Macintosh,
but also available for Windows NT/95. Symantec
Café is based on the Symantec Project
Manager development environment, and has been designed to provide
JAVA development capabilities, which lets
you create JAVA applets and applications
that run on Macintosh, Windows,
and UNIX systems (that's what they said!).
Note that Café's intuitive graphical interface makes creating JAVA
Applets a simple, effortless, and easy task.
-
Microsoft's Visual J++
- another development environment for writing JAVA
applets and applications, this time
by Microsoft (too late, Bill !). Visual
J++ provides a progressive shift for the JAVA
language. It's JAVA plus Component
Object Model (COM). Visual J++ is certified
as JAVA Compatible and allows users to build
cross-platform applications, with specific optimization for the most common
environments, such as Microsoft's Windows 95
and Windows NT (ahh!), without affecting portability.
-
IBM's VisualAge -
is the first enterprise aware, team enabled, incremental application development
environment in the industry. Designed to connect JAVA
clients to existing server data, transactions and applications, it enables
developers to extend server-based applications to communicate with
JAVA clients on the Internet or intranet, rather than rewrite the
application from scratch. VisualAge
for Java creates 100% Pure JAVA
compatible applications, applets and JavaBeans.
LIMBO
- an introduction
Back
to Main Page