| |
EJB Training Overview
Introduction to EJB teaches attendees the skills they need to successfully develop all types of Enterprise JavaBeans, including session beans, entity beans, and message-driven beans. This course is taught using the EJB 3.0 framework
EJB Training Prerequisites
All attendees should have a solid Java™ programming experience. 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.
EJB Training Objectives
- Understand the role of EJB in the broader Java EE platform.
- Describe the features that are implemented by an EJB container on behalf of application components.
- Build stateless session beans as part of a service layer or SOA.
- Build JPA entities to represent persistent data records within the Java application.
- Develop systems of entities to manage complex data models including 1:1, 1:N, and N:N associations.
- Manage transactional behavior of the application through declarative and programmatic techniques.
- Invoke EJB sessions from Java web applications.
- Use dependency injection and JNDI names to assemble complex web/EJB systems with minimal fuss and maximal flexibility.
- Implement message-driven beans to process queued messages asynchronously.
EJB Training Outline
Introduction
A. Overview of EJB and Java Persistence API (JPA)
- Goals of EJB, EJB in the Java EE architecture
B .EJB 3.0 Overview
- Session Beans, Persistent Entities, Message Driven Beans
Session Beans
A. Session Bean Overview
- Services provided, Stateless and Stateful Beans
- Defining a Session Bean - EJB 3 Annotations
- The Bean Implementation, Remote and Local Business Interface
B. Packaging and Deployment
- ejb-jar file, Deployment Descriptors in EJB 3
- EAR file
- The EJB Container
C. JNDI Overview
- Distributed Naming and Lookup
- Context and InitialContext
- Using JNDI
D. Writing an EJB 3 Client
- Client View of a Session Bean
- PortableRemoteObject and Casting
- Running the Client
Additional Capabilities
A. Resources and Dependency Injection
- EJB referencing another EJB
- Referencing Resources, Environment Entries
- Connection Factories (DataSource and others)
B. Session Bean Lifecycle and Interceptors
- Stateless Session Bean Lifecycle
- Business Method Interceptors, InvocationContext, Lifecycle Callback Interceptors, Interceptor Classes
C. Stateful Session Beans
- Overview
- Defining, Client Relationship
- Lifecycle, Activation, Passivation
D. Timer Service
- Overview and usage
Message-Driven Beans
A. Overview of Messaging Systems
- Messaging, Loose Coupling
- Pub/Sub, Point2Poin
B .Overview of JMS API
- Overview and Structure
- ConnectionFactory and Destination
- JMS Producer and Consumer Client example
- JMS Messages
C. Message-Driven Beans (MDB)
- Overview and Goals
- @MessageDriven and MDB example
- Configuring with activationConfig
- State Diagram and Interceptors
Transactions and Security
A. Overview of Transactions and Transactional Systems
- ACID, Tx Lifecycle, Tx Manager, Transactional Objects
B. Transactions in EJB 3
- Declarative Transaction Management
- Transaction Attributes and Transactional Scope
- Transaction Scenarios and Bean-Managed Tx
C. Security
- Java EE Security Overview (Role-based)
- @RolesAllowed, @PermitAll
- Programmatic Security
Exceptions
A. Exception Overview
- Checked and Unchecked Exceptions
B. Exceptions in EJB 3
- Application Exceptions, System Exceptions
C. EJB 3 Best Practices
- When to Use, Coarse-Grained Business Interfaces, Session Facade, Transaction Guidelines, Clusterin
Introduction to Java Persistence API (JPA)
A. Overview
- Persistence Layers, Object-Relational Mapping (ORM), JDBC
- JPA Overview
B. Mapping with JPA
- Entities and @Entity, ids and @Id
- Generated Id Values
- Basic Mapping Types
C. EntityManager
- Persisting to the DB, the EntityManager,
- Persistence Units and Configuration
- Injecting an EntityManager
- Retrieving Persistent Entities
Updates and Queries
A. Inserting and Updating
- Transient, Persistent, Detached, Removed
- Persisting new Entities, Updating a Persistent Instance
B. Querying and JPQL
- Object Based Queries, Select statements, WHERE clause
- Named Queries
C. Versioning and Optimistic Locking
- Detached Instances
- Versioning and Optimistic Locking in EJB 3
Entity Relationships
A. Relationships Overview
- Object Relationships, Participants, Roles, Directionality, Cardinality
B. Relationship Mapping
- Mapping Overview (1-1, 1-N, N-1, N-N)
- Unidirectional and Bidirectional
- Mapping One-One, One-Many and Many-Many
- Join Columns
- Relationship Inverses
- Lazy and Eager Loading
- Cascading
- Queries Across Relationships (Inner Joins, Outer Joins, Fetch Joins)
- JPA
C. Inheritance Mapping
- Entity Inheritance
- Single Table, Joined (Table per Subclass), Table per Concrete Class
- Pros and Cons
Additional JPA Capabilities
A. Queries - Projection, Aggregate, Bulk Update/Delete
B. Embedded Objects
C.EJB 3 and Java SE
D. Best Practices.
- Primary Keys, Named Queries, Lazy/Eager Loading, Transactional Semantics, Encapsulation, Report Queries
|