This course offers the Java programmer a grounding in the Enterprise
JavaBeans (EJB™) architecture and the skills to develop EJBs
effectively for enterprise development efforts. EJBs position at the
heart of the Java Enterprise platform and the use of EJB application
servers as the backbone of large-scale distributed systems are
studied. We consider the advantages of the application server
architecture transaction control, security, persistence, scalability
through pooling and clustering and study the development process for
entity and session beans in depth. The J2EE reference implementation
is used for all demo and lab work, and we emphasize portable EJB 2.1
code.
The focus for the first module is on end-to-end connectivity. The
module follows a path roughly from the data layer to the presentation
layer, so we look at entity beans first, and work demos and exercises
in both Bean-Managed and Container-Managed Persistent Beans. Then the
EJB session layer is considered, and both stateless and stateful
session beans are developed. As part of the lab work, these are hooked
to provided JSPs to illustrate the complete system and typical
architecture.
NOTE: PGJ-107 Java Server Pages and PGJ-108 Java Servlet Programming courses are excellent companions to this
course, and in fact the primary lab track for this module is an
extension of the Java Server Pages modules labs.
Students then proceed to the second module, which begins with some
2.x-specific features, such as message-driven beans and the features
of 2.x container-managed persistence. Two EJB applications are
connected via JMS messaging, one sending messages with raw JMS code,
and one using a message-driven bean to receive and handle those
messages by updating an accounting database. Design implications of
CMP are discussed, as are the new capabilities for EJB design: home
and select methods.
Students then move on to study declarative and programmatic
transaction control. The EJB security architecture is also considered,
and a simple role-based authorization design applied to the courses
main lab project. A short chapter on exception handling in EJB
clarifies the standards for exception propagation and transaction
control.
The next chapter introduces the new features in EJB 2.1 for
implementing SOAP-based Web services, using the JAX-RPC mappings
between Java and WSDL. Also new for 2.1, there is a short chapter on
using the EJB timer service. The course concludes with a chapter on
best-practice EJB development: optimizations, design patterns and
implementation techniques.
Prerequisites: Solid Java programming experience is a must.
PGJ-131 Java 2 Programming is good preparation for this
module. Some experience with distributed systems development,
especially object-based systems such as Java RMI, CORBA, or COM is a
plus. Some knowledge of JDBC is helpful in understanding the EJB
persistence model. Understanding of XML is a plus but is not needed.
On completion of this course, the student should be able to
Understand the role of Enterprise JavaBeans in
enterprise-level systems development, and its relationship to other
J2EE technologies such as JSP, servlets, JMS, CORBA, and XML.
Understand the EJB architecture: the role of the EJB
container in mediating contact between the client and the bean,
transaction control, authorization control, and the importance of
object pooling.
Understand the development cycle for EJBs: Java source code
and compilation, XML deployment descriptors, EJB compilation and
deployment, and use by an application server.
Understand the role of entity beans, their lifecycle and
interactions with the container.
Develop and test BMP and CMP entity beans and understand the
importance of each of the entity-bean methods in assisting the
container in pooling.
Understand the role of session beans, their lifecycle and
interactions with the container.
Develop and test stateless and stateful session beans and
effectively manage passivation/activation cycles.
Use the bean context interfaces to assist with persistence
code and to correctly establish bean-to-bean communication.
Develop message-driven beans and understand their unique
nature within the EJB architecture.
Use 2.x container-managed persistence and make intelligent
design choices based on the practical implications of BMP and CMP
features.
Implement 2.x CMP entity bean relationships.
Understand the EJB transaction architecture and apply
transaction attributes to EJB systems, using both declarative and
programmatic approaches.
Understand the EJB security architecture and apply roles and
authorization attributes to EJB systems again, using both declarative
and programmatic techniques.
Implement SOAP-based Web services using stateless session
beans and JAX-RPC, and understand the relationship between JAXM and
message-driven beans.
Create and respond to EJB timers in bean code.
Tune EJB application servers and EJB code for performance.
Understand and apply design patterns that are important to
common distributed systems and EJB systems in particular.
Instructor-led course, with practical computer-based exercises.
This course requires the J2EE 1.4 reference implementation, which in
turn requires J2SE 1.4. Full documentation for both platforms is
highly recommended. No IDEs are used in the demos and labs, but
students may supply their own.
A graphical web browser is needed to demonstrate and test code any
recent version of Netscape or Explorer will be fine. Netscape
Navigator 4.7 is used in the book and demonstrations, so this would be
an excellent choice.