Reading Notes: Your First Cup: An Introduction to the Java EE Platform
1. Differences Among Three platforms
Java technology is both a programming language and a platform. The Java programming language is a high-level object-oriented language that has a particular syntax and style. A Java platform is a particular environment in which Java programming language applications run.
Three platforms of the Java programming language: Java SE, Java EE, Java ME
All Java platforms consist of a Java VirtualMachine (VM) and an application programming interface (API). The Java VirtualMachine is a program, for a particular hardware and software platform, that runs Java applications. An API is a collection of software components that you can use to create other software components or applications. Each Java platform provides a virtual machine and an API, and this allows applications written for that platform to run on any compatible system with all the advantages of the Java programming language.
Java SE: Java SE's API provides the core functionality of the Java programming language. It defines everything from the basic types and objects of the Java programming language to high-level classes that are used for networking, security, database access, graphical user interface ( GUI) development, and XML parsing.
Java EE: The Java EE platform is built on top of the Java SE platform.Java EE provides an API and runtime environment for developing and running large-scale, multi-tiered, scalable, reliable, and secure network applications.
Java ME: The JavaME platform provides an API and a small-footprint virtual machine for running Java programming language applications on small devices, like cellular phones. The API is a subset of the Java SE API, along with special class libraries useful for small device application development. JavaME applications are often clients of Java EE application services.
2. Overviewof Enterprise Applications
As stated above, the Java EE platform is designed to help developers create large-scale,
multi-tiered, scalable, reliable, and secure network applications. A shorthand name for such
applications is "enterprise applications," so called because these applications are designed to
solve the problems encountered by large enterprises.
The features that make enterprise applications powerful, like security and reliability, often make
these applications complex. The Java EE platform is designed to reduce the complexity of
enterprise application development by providing a development model, API, and runtime
environment that allows developers to concentrate on functionality.
In a multi-tiered application, the functionality of the application is separated into isolated
functional areas, called tiers. Typically, multi-tiered applications have a client tier, a middle tier,
and a data tier (often called the enterprise information systems tier). The client tier consists of a
client program that makes requests to the middle tier. The middle tier's business functions
handle client requests and process application data, storing it in a permanent datastore in the
(1) The ClientTier;
Clients can be a web browser, a stand-alone application, or other servers, and they run on a
different machine from the Java EE server.
The web tier consists of components that handle the interaction between clients and the
business tier. Java EETechnologies Used in theWebTier:
Servlets Java programming language classes that dynamically process requests and construct responses, usually for HTML pages
JavaServer Pages (JSP) Text-based documents that are compiled into servlets and define how dynamic content can be added to static pages, such as HTML pages.
JavaServer Faces technology A user-interface component framework for web applications that allows you to include UI components (such as fields and buttons) on a page, convert and validate UI component data, save UI component data to server-side data stores, and maintain component state.
JavaServer Pages Standard Tag Library A tag library that encapsulates core functionality common to JSP pages
JavaBeans Components Objects that act as temporary data stores for the pages of an application
(3) The BusinessTier
The business tier consists of components that provide the business logic for an application.
Java EETechnologies Used in the BusinessTier
The following Java EE technologies are used in the business tier in Java EE applications:
■ Enterprise JavaBeans (enterprise bean) components
■ JAX-WS web service endpoints
■ Java Persistence API entities
(4) The Enterprise Information SystemsTier
The enterprise information systems (EIS) tier consists of database servers, enterprise resource
planning systems, and other legacy data sources, like mainframes. These resources typically are
located on a separate machine than the Java EE server, and are accessed by components on the
The following Java EE technologies are used to access the EIS tier in Java EE applications:
■ The JavaDatabase Connectivity API (JDBC)
■ The Java Persistence API
■ The J2EE Connector Architecture
■ The Java Transaction API (JTA)
3. Java EE Servers
A Java EE server is a server application that the implements the Java EE platform APIs and
provides the standard Java EE services.Java EE servers are sometimes called application servers,
because they allow you to serve application data to clients, much as how web servers serve web
pages to web browsers.
Java EE servers host several application component types that correspond to the tiers in a
multi-tiered application. The Java EE server provides services to these components in the form
of a container.
Java EE Containers
Java EE containers are the interface between the component and the lower-level functionality
provided by the Java EE platform to support that component. The functionality of the container
is defined by the Java EE platform, and is different for each component type.
The web container is the interface between web components and the web server. A web
component can be a servlet, a JSP page, or a JavaServer Faces page. The container manages the
component's lifecycle, dispatches requests to application components, and provides interfaces
to context data, such as information about the current request.
The Application Client Container
The application client container is the interface between Java EE application clients, which are
special Java applications that use Java EE server components, and the Java EE server. The
application client container runs on the client machine, and is the gateway between the client
application and the Java EE server components that the client uses
The EJB Container
The EJB container is the interface between enterprise beans, which provide the business logic in
a Java EE application, and the Java EE server. The EJB container runs on the Java EE server and
manages the execution of an application's enterprise beans.
4. Architecture of the Example Application
4.1 Architecture of the Example Application
4.2.1 Creating theWeb Service Endpoint
Web services are web-based applications that use open, XML-based standards and transport protocols to exchange data with calling clients. Both the requests and responses are sent as XML documents, and are usually sent as HTTP packets. This makes interoperability between different systems and applications easy, as it is not necessary for the client to know the underlying architecture of the server and vice-versa to make a successful web service call.
Web services are designed to be independent of the client. Typically web service endpoints are
publicly available to a wide variety of clients, and the clients are located throughout the internet.
This is called "loose coupling," as the clients and servers are connected only by the standard
XML-based requests and responses.
4.2.2 Creating the Enterprise Bean
4.2.3 Creating theWeb Client
4.2.4 Building, Packaging, Deploying, and Running