EJB Development

This course is an advanced introduction to the Enterprise Java Beans (EJB) technology. It starts by introducing the concepts and ideal for someone who has never programmed using EJB. The course rapidly picks up and ends with advanced concepts that students can use in real life to complete large scale EJB based projects. The labs are done using Eclipse 3.0 and JBoss IDE 1.3.30. JBoss 3.2.3 application server is used as the server runtime.

After completing this course, the student should be able to:

•Understand the need for EJB
•Understand the EJB 2.0 specification at an expert level
•Understand how to develop, test, and deploy EJBs
•Gain knowledge of J2EE Design Patterns and Best Practices
•Learn the industry secrets in EJB scalability
•Learn how to develop all types of EJB beans using Eclipse and JBoss IDE.

Course Outline



1. Introduction to J2EE and JBoss AS

  • Java Web applications

  • Java Web application architecture

  • J2EE architecture

  • Web application programming model - MVC

  • A scenario of using MVC

  • Typical services provided by application servers

  • Web application development and deployment

  • EAR projects

  • EJB projects


2. Overview

  • Needs for EJB

  • Distributed computing

  • Distributed transaction

  • Distributed security

  • What are EJBs ?

  • Main characteristics of EJBs

  • Foundational technologies of EJBs

  • EJB architecture components

  • EJB client

  • EJB JAR file

  • EJB server

  • EJB container

  • Enterprise JavaBeans

  • Session beans

  • Entity beans

  • EJB classes and interfaces

  • Basic components of entity and session beans

  • EJB home interface

  • An EJB home interface example

  • EJB home object

  • EJB remote interfaces

  • Remote interface example

  • EJB objects

  • EJB implementation class

  • Deployment descriptors

  • How do EJBs work

  • EJB container services

  • EJB application development

  • Deploying enterprise beans

  • Major components of deployed EJBs


3. Session Beans

  • Session beans

  • Stateless session beans

  • Stateful session beans

  • Components of session beans

  • Home interface for session beans

  • Remote interfaces for session beans

  • The session bean class

  • The ejbCreate() method

  • Business methods

  • Deployment descriptors

  • ejb-jar.xml

  • ibm-ejb-jar-bnd.xmi

  • A simple stateless bean example

  • A simple stateful bean example

  • The session context

  • Session bean life cycle

  • Concurrency issues

  • Invoking session beans from a client application

  • Looking up a home object

  • Create an EJB object

  • Calling business methods


4. Entity Beans

  • Entity beans

  • Entity beans components

  • Container

  • Primary key class

  • Home interface

  • Local Home Interface

  • Remote interface

  • Entity bean class

  • Entity instance

  • Entity object life cycle

  • Bean instance life cycle

  • Persistence

  • Bean-managed persistence (BMP)

  • Writing a BMP bean

  • A BMP bean example

  • Container-managed persistence (CMP)

  • Writing a CMP bean

  • A CMP bean example

  • Finder helpers

  • EJB Query Language

  • EJBQL: SELECT, FROM and WHERE Clauses

  • Indicating persistent fields

  • Business methods

  • Entity context

  • Writing CMP beans

  • Object-relational mapping

  • Data mapping with BMP

  • Standard CMP field mapping

  • Defining and mapping CMP fields


5. Exceptions

  • Use of Exception

  • Exception types

  • System Exception

  • Application Exception

  • Bean class

  • Container

  • Client

  • Standard Exceptions


6. Transactions

  • Transaction management

  • Object transaction

  • EJB transaction basics

  • Transaction propagation

  • Client-managed transaction

  • Bean-managed transaction

  • Container-managed transaction

  • Transaction outcome

  • Vetoing transaction

  • Transaction isolation

  • Isolation level


7. Security

  • Goals of the EJB Security specification

  • Declarative EJB security

  • EJB Delegation Policy

  • Programmatic EJB security


8. Message-Driven Beans

  • The Need for Messaging

  • The Java Message Service

  • Queues and Topics

  • Integration JMS and EJB

  • Message-Driven Beans Concepts

  • Security, Transactions, Load Balancing

  • Poison Messages

  • Responding to the Sender


9. J2EE Best Practices

  • Using Session Beans Effectively

  • Dealing with Transactions

  • Optimizing Your Deployment

  • Pooling for Container-Managed Persistence Entity Beans

  • Using Access Beans

  • JDBC Best Practices

  • Java Best Practices


10. J2EE Design Patterns

  • What is a Design Pattern?

  • EJB Layer Design Patterns

  • Transaction and Persistence Patterns

  • Client-Side EJB Interaction Patterns

  • Generating Primary Keys


Appendix A Business Integration Tier Patterns

  • Business Delegate

    • Data Transfer Object pattern



  • Access Bean

  • Value Object

  • Session Facade

  • Composite Entity

  • Value Object Assembler

  • Value List Handler

  • Service Locator

  • Data Access Object

  • Service Activator



Appendix B. Introduction to the JBoss Application Server Platform JBoss Server 3.x Features

  • JBoss Directory Structure


Appendix C. Java Connector Architecture (JCA)

  • Resource Adapter

  • System Contracts

  • Outbound Contracts

  • Inbound Contracts

  • Lifecycle Contracts

  • Common Client Interface (CCI)

  • Advantages of JCA

  • Resource Adapter Packaging

  • Connection Management

  • Transaction Management

  • Transaction Scenario

  • Client Interaction


Audience

This course is intended for intermediate to advanced Java programmers. System architects will find the advanced concepts especially beneficial in designing a framework.