
The design requirements of Java are driven by the nature of the computingenvironments in which software must be deployed.The massive growth of the Internet and the World-Wide Web leads us to acompletely new way of looking at development and distribution of software.To live in the world of electronic commerce and distribution, Java must enablethe development of secure, high performance, and highly robust applications onmultiple platforms in heterogeneous, distributed networks.Operating on multiple platforms in heterogeneous networks invalidates thetraditional schemes of binary distribution, release, upgrade, patch, and so on.To survive in this jungle, Java must be architecture neutral, portable, anddynamically adaptable.The Java system that emerged to meet these needs is simple, so it can be easilyprogrammed by most developers; familiar, so that current developers can easilylearn Java; object oriented, to take advantage of modern software developmentmethodologies and to fit into distributed client-server applications;multithreaded, for high performance in applications that need to performmultiple concurrent activities, such as multimedia; and interpreted, formaximum portability and dynamic capabilities.Together, the above requirements comprise quite a collection of buzzwords, solet’s examine some of them and their respective benefits before going on.1.2.1 Simple, Object Oriented, and FamiliarPrimary characteristics of Java include a simple language that can beprogrammed without extensive programmer training while being attuned tocurrent software practices. The fundamental concepts of Java are graspedquickly; programmers can be productive from the very beginning.Java is designed to be object oriented from the ground up. Object technology hasfinally found its way into the programming mainstream after a gestationperiod of thirty years. The needs of distributed, client-server based systemscoincide with the encapsulated, message-passing paradigms of object-basedsoftware. To function within increasingly complex, network-basedenvironments, 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 thatprovide functionality ranging from basic data types through I/O and networkinterfaces to graphical user interface toolkits. These libraries can be extendedto provide new behavior.Even though C++ was rejected as an implementation language, keeping Javalooking like C++ as far as possible results in Java being a familiar language,while removing the unnecessary complexities of C++. Having Java retain manyof the object-oriented features and the “look and feel” of C++ means thatprogrammers can migrate easily to Java and be productive quickly.
Java is designed for creating highly reliable software. It provides extensivecompile-time checking, followed by a second level of run-time checking.Language features guide programmers towards reliable programming habits.The memory management model—no pointers or pointerarithmetic—eliminates entire classes of programming errors that bedevil C andC++ programmers. You can develop Java language code with confidence thatthe system will find many errors quickly and that major problems won’t laydormant until after your production code has shipped.Java is designed to operate in distributed environments, which means thatsecurity is of paramount importance. With security features designed into thelanguage and run-time system, Java lets you construct applications that can’tbe invaded from outside. In the networked environment, applications writtenin Java are secure from intrusion by unauthorized code attempting to getbehind the scenes and create viruses or invade file systems.1.2.3 Architecture Neutral and PortableJava is designed to support applications that will be deployed intoheterogeneous networked environments. In such environments, applicationsmust be capable of executing on a variety of hardware architectures. Withinthis variety of hardware platforms, applications must execute atop a variety ofoperating systems and interoperate with multiple programming languageinterfaces. To accommodate the diversity of operating environments, the Javacompiler generates bytecodes—an architecture neutral intermediate formatdesigned to transport code efficiently to multiple hardware and softwareplatforms. The interpreted nature of Java solves both the binary distributionproblem and the version problem; the same Java language byte codes will runon any platform.Architecture neutrality is just one part of a truly portable system. Java takesportability 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 typesand the behavior of its arithmetic operators. Your programs are the same onevery platform—there are no data type incompatibilities across hardware andsoftware architectures.The architecture-neutral and portable language environment of Java is knownas the Java Virtual Machine. It’s the specification of an abstract machine forwhich Java language compilers can generate code. Specific implementations ofthe Java Virtual Machine for specific hardware and software platforms thenprovide the concrete realization of the virtual machine. The Java VirtualMachine is based primarily on the POSIX interface specification—an industrystandarddefinition of a portable system interface. Implementing the JavaVirtual Machine on new architectures is a relatively straightforward task aslong as the target platform meets basic requirements such as support formultithreading.
Performance is always a consideration. Java achieves superior performance byadopting a scheme by which the interpreter can run at full speed withoutneeding to check the run-time environment. The automatic garbage collector runsas a low-priority background thread, ensuring a high probability that memoryis available when required, leading to better performance. Applicationsrequiring large amounts of compute power can be designed such thatcompute-intensive sections can be rewritten in native machine code as requiredand interfaced with the Java environment. In general, users perceive thatinteractive applications respond quickly even though they’re interpreted.1.2.5 Interpreted, Threaded, and DynamicThe Java interpreter can execute Java bytecodes directly on any machine towhich the interpreter and run-time system have been ported. In an interpretedenvironment such as Java system, the link phase of a program is simple,incremental, and lightweight. You benefit from much faster developmentcycles—prototyping, experimentation, and rapid development are the normalcase, versus the traditional heavyweight compile, link, and test cycles.Modern network-based applications, such as the HotJava World-Wide Webbrowser, typically need to do several things at the same time. A user workingwith HotJava can run several animations concurrently while downloading animage and scrolling the page. Java’s multithreading capability provides themeans 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 ofsophisticated synchronization primitives: the language library provides theThread class, and the run-time system provides monitor and condition lockprimitives. At the library level, moreover, Java’s high-level system librarieshave been written to be thread safe: the functionality provided by the libraries isavailable without conflict to multiple concurrent threads of execution.While the Java compiler is strict in its compile-time static checking, thelanguage and run-time system are dynamic in their linking stages. Classes arelinked only as needed. New code modules can be linked in on demand from avariety of sources, even from sources across a network. In the case of theHotJava browser and similar applications, interactive executable code can beloaded from anywhere, which enables transparent updating of applications.The result is on-line services that constantly evolve; they can remain innovativeand fresh, draw more customers, and spur the growth of electronic commerceon the Internet.
Java is designed for creating highly reliable software. It provides extensivecompile-time checking, followed by a second level of run-time checking.Language features guide programmers towards reliable programming habits.The memory management model—no pointers or pointerarithmetic—eliminates entire classes of programming errors that bedevil C andC++ programmers. You can develop Java language code with confidence thatthe system will find many errors quickly and that major problems won’t laydormant until after your production code has shipped.Java is designed to operate in distributed environments, which means thatsecurity is of paramount importance. With security features designed into thelanguage and run-time system, Java lets you construct applications that can’tbe invaded from outside. In the networked environment, applications writtenin Java are secure from intrusion by unauthorized code attempting to getbehind the scenes and create viruses or invade file systems.1.2.3 Architecture Neutral and PortableJava is designed to support applications that will be deployed intoheterogeneous networked environments. In such environments, applicationsmust be capable of executing on a variety of hardware architectures. Withinthis variety of hardware platforms, applications must execute atop a variety ofoperating systems and interoperate with multiple programming languageinterfaces. To accommodate the diversity of operating environments, the Javacompiler generates bytecodes—an architecture neutral intermediate formatdesigned to transport code efficiently to multiple hardware and softwareplatforms. The interpreted nature of Java solves both the binary distributionproblem and the version problem; the same Java language byte codes will runon any platform.Architecture neutrality is just one part of a truly portable system. Java takesportability 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 typesand the behavior of its arithmetic operators. Your programs are the same onevery platform—there are no data type incompatibilities across hardware andsoftware architectures.The architecture-neutral and portable language environment of Java is knownas the Java Virtual Machine. It’s the specification of an abstract machine forwhich Java language compilers can generate code. Specific implementations ofthe Java Virtual Machine for specific hardware and software platforms thenprovide the concrete realization of the virtual machine. The Java VirtualMachine is based primarily on the POSIX interface specification—an industrystandarddefinition of a portable system interface. Implementing the JavaVirtual Machine on new architectures is a relatively straightforward task aslong as the target platform meets basic requirements such as support formultithreading.
Performance is always a consideration. Java achieves superior performance byadopting a scheme by which the interpreter can run at full speed withoutneeding to check the run-time environment. The automatic garbage collector runsas a low-priority background thread, ensuring a high probability that memoryis available when required, leading to better performance. Applicationsrequiring large amounts of compute power can be designed such thatcompute-intensive sections can be rewritten in native machine code as requiredand interfaced with the Java environment. In general, users perceive thatinteractive applications respond quickly even though they’re interpreted.1.2.5 Interpreted, Threaded, and DynamicThe Java interpreter can execute Java bytecodes directly on any machine towhich the interpreter and run-time system have been ported. In an interpretedenvironment such as Java system, the link phase of a program is simple,incremental, and lightweight. You benefit from much faster developmentcycles—prototyping, experimentation, and rapid development are the normalcase, versus the traditional heavyweight compile, link, and test cycles.Modern network-based applications, such as the HotJava World-Wide Webbrowser, typically need to do several things at the same time. A user workingwith HotJava can run several animations concurrently while downloading animage and scrolling the page. Java’s multithreading capability provides themeans 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 ofsophisticated synchronization primitives: the language library provides theThread class, and the run-time system provides monitor and condition lockprimitives. At the library level, moreover, Java’s high-level system librarieshave been written to be thread safe: the functionality provided by the libraries isavailable without conflict to multiple concurrent threads of execution.While the Java compiler is strict in its compile-time static checking, thelanguage and run-time system are dynamic in their linking stages. Classes arelinked only as needed. New code modules can be linked in on demand from avariety of sources, even from sources across a network. In the case of theHotJava browser and similar applications, interactive executable code can beloaded from anywhere, which enables transparent updating of applications.The result is on-line services that constantly evolve; they can remain innovativeand fresh, draw more customers, and spur the growth of electronic commerceon the Internet.