Java Enterprise Programming (EJBs, Servlets and JSPs)
Available as an in-house seminar.
This seminar introduces you to the practical development of real-
world, Web-enabled, distributed applications with Java. This means
covering Java2 Enterprise Edition (J2EE) and its key technologies:
Enterprise JavaBeans, Servlets, Java Server
Pages, and the basic architectural patterns used to combine these
technologies into maintainable applications.
Because they're more complex, we'll spend more time on Enterprise
JavaBeans, but we'll also spend enough time on Servlets and JSPs to give
you a solid understanding of the technologies that we use on the Web
tier. And we'll take a quick look at a few of the abstraction APIs that
interface Java with legacy systems, like Java Database Connectivity
(JDBC) and Java Naming and Directory Interface (JNDI).
You'll come out of this course with a comprehensive
understanding of the J2EE architecture, of the problems that it is
designed to solve, how to select the most appropriate tools, and how to
code your solutions.
Prerequisites
To get the most out of this course, you should be familiar with all
the topics listed in the "Thinking in Java
Hands-on" course curriculum (that's the course we recommend as your
entry point to Java), and have solid Java programming experience of at
least one year. You should also be able to read and write relatively
simple HTML and SQL code.
Curriculum Overview
Lectures
-
Introduction to the Seminar
Seminar goals and the application we'll develop (a conference management system)
-
J2EE Architectural Overview
J2EE managed components; J2EE tiers (EJB Tier, Web Tier, Client Tier); separation of labor
-
EJB from the Client Perspective
Creating a simple EJB client application; using JNDI to locate your EJBs
-
Your First Enterprise JavaBean
Implementing a Session Bean to browse the conference catalog
-
EJB Implementation Strategies
Strategies for code reuse; using XDoclet to simplify your EJB development
-
More about Session Beans
Stateless and Stateful Session Beans; bulk accessors and value objects
-
Turning Off Distribution
When, why and how to use local views vs. remote views
-
Container Managed Persistence (CMP)
Object persistence in Enterprise JavaBeans
-
Managing Entity Bean Relationships
Using Container Managed Relationships (CMR); alternatives to CMR
-
EJB Query Language (EJB-QL)
Finding objects with the EJB Query Language
-
Transaction Management
Declarative and programmatic transaction demarcation
-
Customized Object Persistence
Bean Managed Persistence (BMP) Entity Beans; implementation strategies and alternatives
-
Message-Driven Beans (MDB)
Asynchronous, transactional and distributed messaging with MDBs
-
The Web Tier
Components for the Web Tier
-
Implementing Servlets
Handling HTTP requests in your Java code
-
Implementing Filters
Intercepting and chaining HTTP requests
-
JavaServer Pages (JSP)
Creating dynamic web pages
-
Session Management
Java strategies to maintain session state over HTTP
-
Implementing a Model-View-Controller (MVC) Architecture
Separating responsibilities in your Web application
-
Introducing the JSP Standard Template Library (JSTL)
How a tag library can help you with your JSP pages
-
Assembling a Complete J2EE Application
Pulling all the pieces together into deployable units
Exercises
- An EJB Client Application
- Your First Session Bean
- Implementing an EJB with XDoclet
- A Stateful Session Bean
- Implementing Local Interfaces
- Your First Entity Bean
- Using Environment Entries
- Implementing Entity Relationships
- Writing EJB-QL Queries
- Your First Servlet
- Validating User Requests
- Creating the Web Front-End with JSPs
- Maintaining HTTP State Information
- A Controller JSP
- A Controller Servlet
- Using JSTL Custom Tags
- Deploying a Complete J2EE Application
Demos
- Using EJB Handles
- Unit testing your EJBs with JUnit
- Implementing an EJB from business classes
- Implementing an EJB from business interfaces
- Bulk accessors and value objects
- Managing transactions
- Implementing a BMP Entity Bean
Exercises
The exercises are the backbone of this course. Throughout the week,
we'll be incrementally building a simple but complete J2EE application.
The application is a conference management system, something that can
be used:
- By conference managers, to create and edit a conference program
- By speakers, to submit and edit presentation proposals
- By attendees, to create their list of preferred presentations
- By generic users, to browse the conference program
The application will have a Web front-end, but we'll also create
a standalone Java client application that communicates directly with our
Enterprise JavaBeans.
Although we don't have the time to implement all of the features, we'll
code enough to employ Enterprise JavaBeans, Servlets and JSPs in different
ways.
We'll spend about 40% of the time on practical exercises, which are
complemented by the exercise guide. Full solutions to all exercises will
also be provided.
Training material
- Print-out of the course slides
- CD with the exercise guide, solution code, software and related documentation
Hardware
We do not provide computers for the students. You should come to this
seminar with your laptop, after having installed and tested the software
listed below. If you want to bring this seminar in-house, you must
provide the student machines as well.
Please note that we strongly encourage
pair programming for the exercise sessions. If you are coming with a
friend, or if you'll be attending the seminar with a colleague, you may
share one machine between the two of you.
We'll use open-source, freely available software for the entire
seminar. There are good reasons for this:
- Open-source software doesn't require any financial investment on
your part, which you are probably not ready to make if you are
evaluating or approaching this technology for the first time.
- The open-source software we use doesn't come with any bells and
whistles (a.k.a. "wizards" or code generation tools). This means
that you are directly responsible for making all the pieces fit
together, and you have to do it manually. Although this may not be
desirable for production work, understanding how things work is
exactly what you expect from a good course.
- Commercial products do come with bells and whistles; that is,
they often provide sophisticated development environments.
Unfortunately, those environments have an implicit learning curve,
and we cannot afford to spend much time during the seminar on any
product-specific feature. We'll be focusing on the technology, and
95% of what you'll learn in this course you'll be able to apply to
any commercial Application Server.
All the open-source tools we use have won wide acceptance in the
community, with merits like ground-breaking implementation and elegant
design, and are therefore quite robust and are often de facto
standards.
Specifically, we'll use:
- jBoss as our EJB Container.
jBoss is the leading open-source J2EE Application Server.
- Tomcat
as our Servlet Container. Tomcat is part of the Apache/Jakarta
project, and is also the reference implementation for Java Servlet
Containers. We'll use the Tomcat implementation that comes bundled
with jBoss.
- Ant,
which can be thought of as "MAKE for Java." We'll use Ant to run
build scripts during the exercise sessions.
- JUnit, a framework for Java
unit testing, part of the XUnit familiy, which is now a de
facto standard.
- XDoclet, a
Java tool that will generate EJB source files, for example a
deployment descriptor, out of special Javadoc tags that you put in
your Bean implementation code.
NOTE: All the projects listed above tend to evolve quite rapidly.
We want to be sure that you come to the seminar with the lastest version
properly installed on your laptop. To be sure that you don't prematurely
install a wrong version, we will email an installation guide to all
registered attendees two weeks before the seminar.
The only two other things that you'll need are a
Java2 Standard Edition platform,
and a source code editor. Feel free to use your editor of choice, but we
recommend something simple and yet flexible like
UltraEdit (which has a free 45-day
evaluation license).