Enterprise Java Beans (EJB) Workshop Course

Course Code: IN 266
Course Abstract: This course covers all the skills necessary for Java enterprise development with Enterprise Java Beans. It emphasizes portable code practices following J2EE standards which will function correctly on any standards-compliant application server. During the course, participants will develop a complete OLTP application supporting database integration and complex transactions.
Audience:

This course is designed for Programmers who need to perform enterprise development and integration with EJBs.

Duration: 3 days
Learning Outcomes:

Upon completion of this course, the participant will be able to:
> Work with Session EJB Development
> Work with Entity EJB Development
> Use Container Managed Persistence and Relations
> Discuss EJB Design Strategies

Course Topics:

EJB Architecture
Java 2 Enterprise Edition
Major EJB Application Servers
EJB Server Services
EJB Standards
Enterprise Java Beans
Entity EJBs
Session EJBs
Message Driven EJBs
EJB Development Roles
EJB Components: Development
EJB Method Correspondence
EJB Components: Deployment
Deployment Descriptors
EJB Components: Use in Clients
EJB Lookup in Clients
EJB JAR Structure
Deployment on J2SDKEE
sun-j2ee-ri.xml
Server Scripts
Development Scripts
Review: EJB Architecture
Lab: EJB Architecture

EJB Clients
EJB Use in Clients
The Remote Interface
javax.ejb.EJBObject
Example Remote Interface
The Home Interface
javax.ejb.EJBHome
Example Home Interface
Session vs. Entity EJBs
Create vs. Find (Entity EJBs)
Primary Key Class (Entity EJBs)
Example Entity Operations
Example Session Interfaces
Example Session Operations
Retrieving EJB Homes
Casting EJB/CORBA References
Casting Collections of EJB
Closing the JNDI Context
Remote JNDI Lookups
Common Exceptions in Client
Sample Client Code
Service Locator Pattern
Sample Client with Lookup Utility
Review: EJB Clients
Lab: EJB Clients

Entity Beans
Entity EJBs
Container vs. Bean Managed
EJB 2.0 CMP Fields
CMP to Table Mapping
javax.ejb.EntityBean
EntityAdapter Utility Class
Example EntityAdapter Class
Entity Components: Development
EJB Method Correspondence
Structure: CMP Entity EJB Class
Structure: Abstract CMP Methods
Structure: Home Methods
CMP Fields and Encapsulation
Structure: Business Methods
CMP Deployment Descriptor
EJB 1.1 CMP
CMP Finder Methods
Finder Query Definitions
Code Generation
EJBMaker Tool
Review: Entity Beans
Lab: Entity Beans

Session Beans
Session EJBs
Stateless vs. Stateful
javax.ejb.SessionBean
SessionAdapter Utility Class
Structure: Session EJB Class
Business and Create Methods
Session Deployment Descriptor
EJB Exception Handling Basics
EJB Transactions Basics
Stateful Session EJBs
Example Stateful Session EJB
Using Stateful Session EJB
Stateless vs. Stateful Lifecycle
Pass By Reference or Value
Example: Copy of Item Collection
Performance of Remote vs. Local
Alternatives to Stateful Session
Example: Alternative to Stateful
Review: Session Beans
Lab: Session Beans

EJB Lifecycle
Stateless Session EJB Lifecycle
Stateless Session EJB Pooling
Pooled EJB Invocations
Stateless Session EJB Techniques
Stateful Session EJB Lifecycle
Stateful Session EJB Transitions
Stateful Session EJB Techniques
Entity EJB Lifecycle
Entity Transition: DNE to Pooled
Entity Transition: create()
Entity Transition: find()
Entity Transition: remove()
Entity Passivation/Activation
Usefulness of ejbActivate/Passivate
Method Calls and ejbLoad/Store()
Why Load/Store is so Inefficient
Entity EJB Techniques
Entity Value Objects
Example Value Object
Example Value Getters/Setters
Review: EJB Lifecycle
Lab: EJB Lifecycle

Bean Managed Persistence
Container vs. Bean Managed
BMP Lifecycle Methods
JDBC and Data Sources
EntityAdapter Class
Manipulating the Primary Key
EJB Method Correspondence
Structure: BMP Entity EJB Class
BMP: Fields/Business Methods
BMP: ejbCreate()
BMP: ejbFindByPrimaryKey()
BMP: ejbFindAll()
BMP: ejbLoad()
BMP: ejbStore()
BMP: ejbRemove()
BMP: getConnection()
BMP: Utility Methods
BMP: SQL Strings
BMP Deployment Descriptor
Table & Datasource Configuration
Pros and Cons of CMP and BMP
Review: BMP
Lab: BMP

Deployment Descriptors
Configuration Information
ejb-jar.xml Structure
Common EJB Information
Entity and Session Specific Info
CMP Entity Information
Finder Query Definitions
Environmental Entries
EJB References
Security References
Resource References
Querying the EJB Environment
Environment Entries as Constants
Local Interfaces (EJB 2.0)
Example Local Interface
Example Local Home Interface
EJBLocalObject & EJBLocalHome
Retrieving Local EJB References
Example: Local EJB Use
EJBMaker Environmental Entries
EJBMaker and Local Interfaces
Review: Deployment Descriptors
Lab: Deployment Descriptors

Transactions and Security
Assembly Descriptor
Security Roles
EJB Security Identity (EJB 2.0)
Method Permissions
Permissions for Groups of Methods
User Authentication
Accessing Security Info in EJBs
Exclude Lists (EJB 2.0)
Transactions
EJB Transactions Basics
Container-Managed Transactions
Transaction Attributes
Calls to NotSupported / Required
Calls to Supported / RequiresNew
Calls to Mandatory / Never
Transactions and Exceptions
Using System Exceptions
Using Application Exceptions
Application Exceptions in Caller
Explicit Transaction Rollback
Alternate Logic for Exceptions
Bean-Managed Transactions
Review: Transactions and Security
Lab: Transactions and Security

EJB 2.0 CMP
EJB 2.0 Additions to CMP
Object-to-Relational Mapping
Container Managed Relations
Kinds of CMR
Reciprocal vs. One-Way CMR
Abstract CMR Fields
CMR Fields and Encapsulation
Using Multiplicity-One Fields
Using Multiplicity-Many Fields
CMR Collection Behavior
CMR Relationships in ejb-jar.xml
EJB Relationship Role Tag
Reciprocal Relationship Tags
Cascade Deletes
Limitations of CMR
EJB QL
Basic EJB QL Structure
Finder Method Parameters
Navigating CMR in EJB QL
SQL Operations & Select Methods
Limitations of EJB QL
Review: EJB 2.0 CMP
Lab: EJB 2.0 CMP

EJB Design Strategies
Service Locator Pattern
Session EJB and Transactions
Business Object or Data Gateway
Compromise on Proper Entity Use
Value/Data Transfer Objects
Listing Methods
BMP Listing Method
CMP Listing Method
Entity Helper Session EJB
Primary Key Generation
Modifying the Create Method
Business Delegates
Example Business Delegates
Using Business Delegates
Concurrency Problems
Stale Data in the Client
Concurrency Solutions
Review: EJB Design Strategies
Lab: EJB Design Strategies

Prerequisites:

Experience with the core Java language and database integration with JDBC are required.

COURSE VARIANTS
There are slightly different versions of this course, depending on the choice of application server/servlet engine. Supported servers include:

>J2EE Software Design Kit
>Apache Tomcat (open source offering)
>Sun Microsystem's iPlanet
>BEA's Weblogic
>IBM's Websphere
>Allaire's JRun

Dependant on the choice of server, several JDBC-compliant databases are supported,
including:

>Cloudscape (non-commercial version accompanying the J2EESDK).
>Oracle
>IBM's DB2

Custom development for any standard-compliant application server and database is
available.

Note: All fields are required
At the present time we do not offer training for individuals or groups less then 6 individuals. We apologize for any inconvenience.


We Value Your Privacy!

Ready to get started or in need of more information? Contact us today.

Go To Blog Virtual Learning