Go To AppexTech

EJB Training

1: Hour Daily

Duration :-Months

 

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)

  1.   Goals of EJB, EJB in the Java EE architecture

B  .EJB 3.0 Overview

  1. Session Beans, Persistent Entities, Message Driven Beans

Session Beans

A. Session Bean Overview

  1. Services provided, Stateless and Stateful Beans
  2. Defining a Session Bean - EJB 3 Annotations
  3. The Bean Implementation, Remote and Local Business Interface

B. Packaging and Deployment

  1. ejb-jar file, Deployment Descriptors in EJB 3
  2. EAR file
  3. The EJB Container

C. JNDI Overview

  1. Distributed Naming and Lookup
  2. Context and InitialContext
  3. Using JNDI

D. Writing an EJB 3 Client

  1. Client View of a Session Bean
  2. PortableRemoteObject and Casting
  3. Running the Client

Additional Capabilities

A. Resources and Dependency Injection

  1. EJB referencing another EJB
  2. Referencing Resources, Environment Entries
  3. Connection Factories (DataSource and others)

B.  Session Bean Lifecycle and Interceptors

  1. Stateless Session Bean Lifecycle
  2. Business Method Interceptors, InvocationContext, Lifecycle Callback Interceptors, Interceptor Classes

C. Stateful Session Beans

  1. Overview
  2. Defining, Client Relationship
  3. Lifecycle, Activation, Passivation

D. Timer Service

  1. Overview and usage

Message-Driven Beans

A. Overview of Messaging Systems

  1. Messaging, Loose Coupling
  2. Pub/Sub, Point2Poin

B .Overview of JMS API

  1. Overview and Structure
  2. ConnectionFactory and Destination
  3. JMS Producer and Consumer Client example
  4. JMS Messages

C. Message-Driven Beans (MDB)

  1. Overview and Goals
  2. @MessageDriven and MDB example
  3. Configuring with activationConfig
  4. State Diagram and Interceptors

Transactions and Security 

A. Overview of Transactions and Transactional Systems

  1. ACID, Tx Lifecycle, Tx Manager, Transactional Objects

B. Transactions in EJB 3

  1. Declarative Transaction Management
  2. Transaction Attributes and Transactional Scope
  3. Transaction Scenarios and Bean-Managed Tx

C. Security

  1. Java EE Security Overview (Role-based)
  2. @RolesAllowed, @PermitAll
  3. Programmatic Security

Exceptions

A. Exception Overview

  1. Checked and Unchecked Exceptions

B. Exceptions in EJB 3

  1. Application Exceptions, System Exceptions

C. EJB 3 Best Practices

  1. When to Use, Coarse-Grained Business Interfaces, Session Facade, Transaction Guidelines, Clusterin

Introduction to Java Persistence API (JPA)

A. Overview

  1. Persistence Layers, Object-Relational Mapping (ORM), JDBC
  2. JPA Overview

B. Mapping with JPA

  1. Entities and @Entity, ids and @Id
  2. Generated Id Values
  3. Basic Mapping Types

C. EntityManager

  1. Persisting to the DB, the EntityManager,
  2. Persistence Units and Configuration
  3. Injecting an EntityManager
  4. Retrieving Persistent Entities

Updates and Queries

A. Inserting and Updating

  1. Transient, Persistent, Detached, Removed
  2. Persisting new Entities, Updating a Persistent Instance

B. Querying and JPQL

  1. Object Based Queries, Select statements, WHERE clause
  2. Named Queries

C. Versioning and Optimistic Locking

  1. Detached Instances
  2. Versioning and Optimistic Locking in EJB 3

Entity Relationships

A. Relationships Overview

  1. Object Relationships, Participants, Roles, Directionality, Cardinality

B. Relationship Mapping

  1. Mapping Overview (1-1, 1-N, N-1, N-N)
  2. Unidirectional and Bidirectional
  3. Mapping One-One, One-Many and Many-Many
  4. Join Columns
  5. Relationship Inverses
  6. Lazy and Eager Loading
  7. Cascading
  8. Queries Across Relationships (Inner Joins, Outer Joins, Fetch Joins)
  9. JPA

C. Inheritance Mapping

  1. Entity Inheritance
  2. Single Table, Joined (Table per Subclass), Table per Concrete Class
  3. 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.

  1. Primary Keys, Named Queries, Lazy/Eager Loading, Transactional Semantics, Encapsulation, Report Queries

 Back