Previous Table of Contents Next


CHAPTER 1
An Introduction to Java Enterprise Development

Developing enterprise applications requires an understanding of many technologies. In addition to understanding Java, it is important to understand the technologies that support networking, the Web, and database connectivity. Often, the enterprise developer is faced with the task of applying very specific knowledge about a technology to the problem of connecting it with another possibly unknown application.

This chapter introduces some of the concepts that support enterprise Java development. Once these concepts are defined, the main enterprise Java technologies are introduced. The remainder of this book discusses these technologies in detail.

Supporting Concepts

A number of concepts support enterprise Java technologies. These concepts include HTTP, threads, and the Java language itself. Let’s take a look at these basic concepts. If you are familiar with these concepts, feel free to jump ahead to the section entitled “Enterprise Technologies.”

HTTP

Many of the applications being written today are being deployed on the World Wide Web or in a miniature version of the Web inside a corporate network. Most likely you are familiar with the Web, but you may not have had to deal with the protocols that drive it.

The primary protocol that drives the Web is called the HyperText Transfer Protocol (HTTP). Although the name implies that this protocol is used only to transfer text, it can actually be used for any type of file. HTTP creates a relationship between a resource provider (the server) and a resource requester (the client). All HTTP interactions occur in the form of requests. The client sends a request, and the server replies. Between requests, there is no connection between the client and the server, making HTTP a stateless protocol.

Each HTTP request and reply includes a header and a body. The header contains configuration information such as the resource being requested. The body for a request can contain information relevant to the request; the body of the reply contains the requested information. A number of request types can be used, each indicated in the header. The first, called GET, is used to request a resource. POST requests also ask for a resource but are expected to include information, often from an HTML form, along with the request. PUT requests are used to put data on the server; other, more esoteric request types can be used to query the server and perform other operations.

As far as the content of this book is concerned, the main concepts that you need to understand are that HTTP is stateless, there are several types of HTTP requests, and the requests contain a header and a body.

Java

A number of Java concepts are particularly relevant to enterprise programming. First, enterprise applications often require the use of multiple threads. Second, many of the enterprise technologies require object serialization. Finally, enterprise applications must be deployed to be used.

Perhaps the only one of these concepts that is appropriate to mention in this book is deployment. As Java has matured, a number of important deploymentoriented technologies have been released. First, the Java Runtime Environment (JRE) is a version of the Java interpreter and classes intended for deployment rather than development. The JRE does not include the development tools but does include the classes required to run Java applications. JDK 1.1 uses a separate JRE; JDK 1.2 (now called Java 2) integrates the JRE into the JDK, providing JRE addons for development tools.

The second big step in deployment is the Java plugin, which is available for JDK 1.1 and Java 2. The Java plugin is a browser extension that works with Microsoft Internet Explorer and Netscape Navigator. Basically, the plugin is like the JRE for a browser. Users who install the plugin can run Java applets using the associated version of Java. This is a great leap forward because the browser vendors were hard pressed to keep their Java versions in sync with the versions being released by Sun. Using the Java plugin, you can release to your customers applets that use the latest technologies, without waiting for customers’ browsers to be updated.

Specialized Servers

Enterprise development adds a new layer of servers to the basic Web application. Whereas the Web has Web servers, enterprise applications have databases, application servers, and transaction monitors. You may already be familiar with databases. Application servers are programs that provide servertype services such as resource management to extensions written by enterprise developers. The goal of application servers is to manage the “hard parts” of client/server programming. Transaction monitors are a special type of server that manages distributed transactions. These transactions are discussed more in Chapter 23, “Using Transactions with Enterprise JavaBeans.”

Basic Enterprise Design

Over the past couple years, a number of buzzwords have been coined to describe the basic designs for enterprise applications. In particular, the terms threetier and ntier are used to describe enterprise applications that reside on the client and several servers. This book describes and discusses a number of variations on the tiered application theme. Specifically, twotier applications, such as the designs pictured in Figure 1.1, are created. These might connect a client to a Web server or database.

Extending a twotier application to three tiers allows the programmer to leverage other resources. In particular, the server can use a database for storing information or an application server to process information. Several threetier application designs are pictured in Figure 1.2.


Previous Table of Contents Next