The Next Stage of the Known,
Or a Completely New Paradigm?
Taiichi Sakaiya--The Knowledge-Value Revolution
The Software Developer's Burden
Imagine you're a software application developer. Your programming language of choice (or the language that's been foisted on you) is C or C++ . You've been at this for quite a while and your job doesn't seem to be getting any easier. These past few years you've seen the growth of multiple incompatible hardware architectures, each supporting multiple incompatible operating systems, with each platform operating with one or more incompatible graphical user interfaces. Now you're supposed to cope with all this and make your applications work in a distributed client-server environment. The growth of the Internet, the World-Wide Web, and "electronic commerce" have introduced new dimensions of complexity into the development process.
The tools you use to develop applications don't seem to help you much. You're still coping with the same old problems; the fashionable new object-oriented techniques seem to have added new problems without solving the old ones. You say to yourself and your friends, "There has to be a better way"!
The Better Way is Here Now
Now there is a better way--it's the Java programming language environment ("Java" for short) from Sun Microsystems. Imagine, if you will, this development world...
At the end of this paper you'll find a chapter that describes the HotJava Browser ("HotJava" for short). HotJava is an innovative World-Wide Web browser, and the first major applications written using the Java environment. HotJava is the first browser to dynamically download and execute Java code fragments from anywhere on the Internet, and to so so in a secure manner.
Java originated as part of a research project to develop advanced software for a wide variety of networked devices and embedded systems. The goal was to develop a small, reliable, portable, distributed, real-time operating environment. When the project started, C++ was the language of choice. But over time the difficulties encountered with C++ grew to the point where the problems could best be addressed by creating an entirely new language environment. Design and architecture decisions drew from a variety of languages such as Eiffel, SmallTalk, Objective C, and Cedar/Mesa. The result is a language environment that has proven ideal for developing secure, distributed, network-based end-user applications in environments ranging from networked-embedded devices to the World-Wide Web and the desktop.
The massive growth of the Internet and the World-Wide Web leads us to a completely new way of looking at development and distribution of software. To live in the world of electronic commerce and distribution, Java must enable the development of secure, high performance, and highly robust applications on multiple platforms in heterogeneous, distributed networks.
Operating on multiple platforms in heterogeneous networks invalidates the traditional schemes of binary distribution, release, upgrade, patch, and so on. To survive in this jungle, Java must be architecture neutral, portable, and dynamically adaptable.
The Java system that emerged to meet these needs is simple, so it can be easily programmed by most developers; familiar, so that current developers can easily learn Java; object oriented, to take advantage of modern software development methodologies and to fit into distributed client-server applications; multithreaded, for high performance in applications that need to perform multiple concurrent activities, such as multimedia; and interpreted, for maximum portability and dynamic capabilities.
Together, the above requirements comprise quite a collection of buzzwords, so let's examine some of them and their respective benefits before going on.
Java is designed to be object oriented from the ground up. Object technology has finally found its way into the programming mainstream after a gestation period of thirty years. The needs of distributed, client-server based systems coincide with the encapsulated, message-passing paradigms of object-based software. To function within increasingly complex, network-based environments, programming systems must adopt object-oriented concepts. Java provides a clean and efficient object-based development environment.
Programmers using Java can access existing libraries of tested objects that provide functionality ranging from basic data types through I/O and network interfaces to graphical user interface toolkits. These libraries can be extended to provide new behavior.
Even though C++ was rejected as an implementation language, keeping Java looking like C++ as far as possible results in Java being a familiar language, while removing the unnecessary complexities of C++. Having Java retain many of the object-oriented features and the "look and feel" of C++ means that programmers can migrate easily to Java and be productive quickly.
Java is designed to operate in distributed environments, which means that security is of paramount importance. With security features designed into the language and run-time system, Java lets you construct applications that can't be invaded from outside. In the networked environment, applications written in Java are secure from intrusion by unauthorized code attempting to get behind the scenes and create viruses or invade file systems.
Architecture neutrality is just one part of a truly portable system. Java takes portability a stage further by being strict in its definition of the basic language. Java puts a stake in the ground and specifies the sizes of its basic data types and the behavior of its arithmetic operators. Your programs are the same on every platform--there are no data type incompatibilities across hardware and software architectures.
The architecture-neutral and portable language environment of Java is known as the Java Virtual Machine. It's the specification of an abstract machine for which Java language compilers can generate code. Specific implementations of the Java Virtual Machine for specific hardware and software platforms then provide the concrete realization of the virtual machine. The Java Virtual Machine is based primarily on the POSIX interface specification--an industry-standard definition of a portable system interface. Implementing the Java Virtual Machine on new architectures is a relatively straightforward task as long as the target platform meets basic requirements such as support for multithreading.
Modern network-based applications, such as the HotJava World-Wide Web browser, typically need to do several things at the same time. A user working with HotJava can run several animations concurrently while downloading an image and scrolling the page. Java's multithreading capability provides the means to build applications with many concurrent threads of activity. Multithreading thus results in a high degree of interactivity for the end user.
Java supports multithreading at the language level with the addition of sophisticated synchronization primitives: the language library provides the Thread
class, and the run-time system provides monitor and condition lock primitives. At the library level, moreover, Java's high-level system libraries have been written to be thread safe: the functionality provided by the libraries is available without conflict to multiple concurrent threads of execution.
While the Java compiler is strict in its compile-time static checking, the language and run-time system are dynamic in their linking stages. Classes are linked only as needed. New code modules can be linked in on demand from a variety of sources, even from sources across a network. In the case of the HotJava browser and similar applications, interactive executable code can be loaded from anywhere, which enables transparent updating of applications. The result is on-line services that constantly evolve; they can remain innovative and fresh, draw more customers, and spur the growth of electronic commerce on the Internet.
java.lang
--the collection of base types (language types) that are always imported into any given compilation unit. This where you'll find the declarations of Object
(the root of the class hierarchy) and Class
, plus threads, exceptions, wrappers for the primitive data types, and a variety of other fundamental classes.
java.io
--streams and random-access files. This is where you find the rough equivalent of the Standard I/O Library you're familiar with on most UNIX systems. A further library is called java.net
, and provides support for sockets, telnet interfaces, and URLs.
java.util
--container and utility classes. Here you'll find classes such as Dictionary
, HashTable
, and Stack
, among others, plus encoder and decoder techniques, and Date
and Time
classes.
java.awt
--an Abstract Windowing Toolkit that provides an abstract layer enabling you to port Java applications easily from one window system to another. This library contains classes for basic interface components such as events, colors, fonts, and controls such as buttons and scrollbars.
Developing your applications using Java results in software that is portable across multiple machine architectures, operating systems, and graphical user interfaces, secure, and high performance. With Java, your job as a software developer is much easier--you focus your full attention on the end goal of shipping innovative products on time, based on the solid foundation of Java. The better way to develop software is here, now, brought to you by the Java language environment.
The Java(tm) Language Environment: A White Paper