Thursday, October 14, 2010

1.2 Design Goals of Java


The design requirements of Java are driven by the nature of the computing
environments in which software must be deployed.
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.

1.2.1 Simple, Object Oriented, and Familiar

Primary characteristics of Java include a simple language that can be
programmed without extensive programmer training while being attuned to
current software practices. The fundamental concepts of Java are grasped
quickly; programmers can be productive from the very beginning.
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.
1.2.2 Robust and Secure

Java is designed for creating highly reliable software. It provides extensive
compile-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 pointer
arithmetic—eliminates entire classes of programming errors that bedevil C and
C++ programmers. You can develop Java language code with confidence that
the system will find many errors quickly and that major problems won’t lay
dormant until after your production code has shipped.

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.

1.2.3 Architecture Neutral and Portable

Java is designed to support applications that will be deployed into
heterogeneous networked environments. In such environments, applications
must be capable of executing on a variety of hardware architectures. Within
this variety of hardware platforms, applications must execute atop a variety of
operating systems and interoperate with multiple programming language
interfaces. To accommodate the diversity of operating environments, the Java
compiler generates bytecodes—an architecture neutral intermediate format
designed to transport code efficiently to multiple hardware and software
platforms. The interpreted nature of Java solves both the binary distribution
problem and the version problem; the same Java language byte codes will run
on any platform.

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 industrystandard
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.

1.2.4 High Performance

Performance is always a consideration. Java achieves superior performance by
adopting a scheme by which the interpreter can run at full speed without
needing to check the run-time environment. The automatic garbage collector runs
as a low-priority background thread, ensuring a high probability that memory
is available when required, leading to better performance. Applications
requiring large amounts of compute power can be designed such that
compute-intensive sections can be rewritten in native machine code as required
and interfaced with the Java environment. In general, users perceive that
interactive applications respond quickly even though they’re interpreted.

1.2.5 Interpreted, Threaded, and Dynamic

The Java interpreter can execute Java bytecodes directly on any machine to
which the interpreter and run-time system have been ported. In an interpreted
environment such as Java system, the link phase of a program is simple,
incremental, and lightweight. You benefit from much faster development
cycles—prototyping, experimentation, and rapid development are the normal
case, versus the traditional heavyweight compile, link, and test cycles.
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.

0 comments:

Post a Comment