Java
Java is a software platform intended to modernize programming on a universal scale. The chief inventor was James Gosling working for Sun Microsystems which has retained the governance of the Java platform specifications. A strong community of other companies and users has developed and affected the development chiefly IBM and Apple.
Gosling’s hope for development on the platform was encompassed in the slogan
“Write once, run anywhere.”
Unfortunately, the realization has often followed the mocking slogan:
“Write once, debug everywhere.”
The name Java is a reference to coffee but was not the original namedesired by Gosling.
1 The platform
The platform is comprised of several levels of abstraction.
- •
Every Java platform operates with a core kernel which is designed and implemented for specific physical settings. There are Java kernelstargeted for multiprocessor Sparc and Itanium server environments all the way down to StrongArm and even Smart-Card chips. IBM has even prototype processors equipped to operate as solid state Java kernels. Access to this layer from the other platforms is achieved through jave.lang packages as well as through the Java Native Interface.
The simplest method to create a kernel is to build an interpreter in thelanguage
and tools of a given operating system, such as Microsoft Windows,Apple’s OS-X, and various Linux and Unix distributions. This unnecessarylayer is generally responsible for slower performance on time critical tasksand may be responsible for much of the limited adoption of platform for large scale home or office applications.
The most notable divergence of the kernel from C style applications isgarbage collection
. Memory in Java is managed completely by the kernel andso programmers cannot use dangerous tricks such as incrementing or decrementing pointers beyond the bounds of the array or structure
allocated to pointer.However, by retaining deletion controls, some critical optimizations may notbe able release resources when desired.
- •
The second layer is the programming language and its suite of standardpackages. The language uses the C syntax but unlike C++ makes an explicituse of object oriented structures. The concept of exceptions, experimentally introduced in C++, is given a robust form thus removing the need tocheck returns for errors. An error in Java reverses the execution directionof the thread “throwing” exception to the calling functions
until somelayer is capable of handling the error. An unexpected result of this is thatsome programs now use the exception mechanism as a valid exit strategy froma loop of recursion thus in effect providing for an unbounded
number of typesas the result of a method invocation.
The language has single inheritance but allows for polymorphism through interface structures. This avoids the danger of C++ multiple inheritance.
The various packages, for example: java.util, java.awt, java.net, etc. provide uniform access to standard features of mosthardware systems. For example, data structures such as lists, trees, queue, etc. are provided in the utility package. AWT controls standard windowing controls which allows for elegant and simply built graphical user interfaces. Packages such as the net package provide very direct methods to access internet controls (TCP/IP stacks) and provide conversions betweenvarious formats on the web. This makes network applications very favorableas there is no concern over which operating systems are linked togetherthrough the programs.
- •
At the most abstract layer to the platform are the extended packages.These include packages to control databases, XML utilities, 3-D packages,speech and natural language, and perhaps the most comprehensive dedication toaccessibility and internationalization.
2 The standards
Having developed the Java platform from the ground up there was a rare opportunity to establish conventions to form a uniform development lookwhich would promote ease of development. Data types are named with a capitalletter for each new word or initial. For example, the data structureencoding a list is written List. The exception to this ruleare the primitive data types of integers, floating points, etc. Theseare written int, long, boolean, etc.
In contrast, variables (references) begin with a lower case but may haveupper case letters for subsequent words or initials. For example,an instance of an object LargeInteger could be namedlargeInt.
Unlike the Microsoft Hungarian notation, references are not labeled withshort hand letters revealing their type. Because Java is a strongly typedprogramming language, much of the type problems of C/C++ solved by Hungariannotation is unnecessary as the problems are caught at compile time. The trade off is the inflexibility of programming in that data must be explicitly castto the appropriate data type even when provably clear in theprogram. Later languages, such as Python, are in sharp contrast to Java in thisregard.
At larger level, the names of new packages carry with them the website names of the developers. For example com.sun.java.swing or com.ibm.java.speech are packages from Sun Microsystems and IBM, as is easily detected in the package names. Linking between libraries is thus simply a matter of identifying the package name and is not affected by separate MAKE files etc. as is common in C/C++ settings.
3 Mathematical and scientific applications
In the world of mathematical and scientific computation, the use of Java is limited. Most theoretical applications are encumbered by unnecessary user interfaces and the strong need to optimize makes garbage collects and especially interpreters very unfavorable. The one place were the Java platform is poised for use on large scale mathematical projects is in distributed computing problems such as searches for primes etc.
3.1 External links
http://www.mirwoj.opus.chelm.pl/ca/mjcell/mjcell.htmlMirek’s Java Cellebration v.1.50