0% found this document useful (0 votes)
92 views24 pages

BCD Session 01

The document discusses Enterprise Java Beans (EJB) technology and the EJB 3.0 specification. It covers topics like EJB components, annotations, the Java EE application architecture, and the process of creating EJB applications. The document contains information through a series of slides intended to educate about EJB and Java EE application development.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPS, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views24 pages

BCD Session 01

The document discusses Enterprise Java Beans (EJB) technology and the EJB 3.0 specification. It covers topics like EJB components, annotations, the Java EE application architecture, and the process of creating EJB applications. The document contains information through a series of slides intended to educate about EJB and Java EE application development.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPS, PDF, TXT or read online on Scribd
You are on page 1/ 24

Business Component Development Using EJB Technologies

Objectives

In this session, you will learn to:


Identify characteristics of Enterprise Java Beans technology,
for EJB 3.0 specification
Identify the use of annotations
Define the Java Platform, Enterprise Edition (Java EE)
Examine the Java EE application architecture
Examine the EJB application creation process
Compare the Java EE application development with traditional
enterprise application development

Ver. 1.0

Slide 1 of 24

Business Component Development Using EJB Technologies


EJB 3.0 Specification

Enterprise JavaBeans (EJB) is defined as a server-side


component framework that builds enterprise-class
distributed component applications in Java.
You can create scalable, reliable, transactional, secure, and
multi-user distributed applications by using EJB.
EJB is designed to support application portability and
reusability across any vendors enterprise middleware
services.
The new EJB3.0 API offers ample of simplification over the
previous version EJB API.

Ver. 1.0

Slide 2 of 24

Business Component Development Using EJB Technologies


Prior to EJB 3.0

The following list briefly describes some of the general EJB


2.x implementation artifact:
Enterprise bean class
EJB object
Remote interface
Local interface
Home interface
Deployment descriptor
Vendor-specific files
The Ejb-jar file

Ver. 1.0

Slide 3 of 24

Business Component Development Using EJB Technologies


EJB 3.0 Enterprise Bean

EJB 3.0 beans are the Plain Old Java Object (POJO) styled
beans as opposed to pre-EJB 3.0 enterprise beans that
used to constitute multiple Java classes and interface per
EJB component.
EJB 3.0 bean has all its code contained in a single Java
class.
EJB 3.0 enterprise bean provides a single business
interface for both local and remote clients.
EJB 3.0 bean provides a bean class that provides definitions
of only the business interface.
EJB 3.0 bean does not have a home interface.
A message-driven bean, in EJB 3.0, doesnt need a
business interface.

Ver. 1.0

Slide 4 of 24

Business Component Development Using EJB Technologies


EJB 3.0 Enterprise Bean (Contd.)

The bean provider is not required, in EJB 3.0, to implement


the component interface regardless of whether it is needed
or not.
The bean class does not have to implement the component
interfaces, javax.ejb.SessionBean for a session bean or
javax.ejb.MessageDrivenBean for a message-driven bean.

Ver. 1.0

Slide 5 of 24

Business Component Development Using EJB Technologies


Annotations

The use of annotation is one of the most important features


of EJB 3.0 specification.
They have been added to the java language in Java Service
Request 175 (JSR) and made available since the release of
Java 5 platform.
Annotation is defined as the metadata that consists of the
additional definition that can be attached inside your source
file.
They can be used as an alternative to the standard XML
deployment descriptor files.
Java annotations provide information about the code in the
code itself. They are complied and type-checked. They can
be accessed at the runtime by using Java reflection, but
cannot perform computation.
Ver. 1.0

Slide 6 of 24

Business Component Development Using EJB Technologies


Annotations (Contd.)

Annotations can be applied to various elements of the Java


code such as methods, variables, constructors, package
declarations, and so on.
Annotations begin with an @ sign followed by the
annotation name which in turn is followed by annotation
data.
You can use annotations if:
The metadata you are applying changes the design of the
class.
The metadata changes the design of code interacting with the
class.

Ver. 1.0

Slide 7 of 24

Business Component Development Using EJB Technologies


Annotations (Contd.)

Benefits of using annotations in Java:


Annotations are compiled by Java language compiler,
therefore no external tools are required.
Annotations are potable, because the metadata is
standardized.
Annotations on a class can be kept in a class file and retained
for accessing at the runtime.

Drawbacks of annotations:
Annotation cannot form an inheritance hierarchy like interfaces
and classes.
Annotation data member types are restricted to primitive types,
String, Class, enum, annotation types, and arrays of the
preceding types.
You must access permission on the code, to annotate it.

Ver. 1.0

Slide 8 of 24

Business Component Development Using EJB Technologies


Introducing the Java Platform Enterprise Edition (Java EE)

Java EE is the standard for developing portable, robust,


scalable, and secure server-side Java applications.
The Java EE platform consists:
A set of specifications.
Java EE 5 Software Development Kit (Java EE 5 SDK).
Commercial and open source Java EE application servers and
tools.
Java EE components and applications.

Ver. 1.0

Slide 9 of 24

Business Component Development Using EJB Technologies


Examining the Java EE Application Architecture

The key features of the component-container architecture


are:
Separation of application specific functionality and application
generic functionality.
Components consist of application specific functionality.
Containers consist of the generic functionality common to all
enterprise applications.
Containers provide an execution environment for components.
Containers provide services for components.

Ver. 1.0

Slide 10 of 24

Business Component Development Using EJB Technologies


Examining the Java EE Application Architecture (Contd.)

The following figure shows the component-container


architecture.

Ver. 1.0

Slide 11 of 24

Business Component Development Using EJB Technologies


Examining the Java EE Application Architecture (Contd.)

The following figure shows the Java EE containers


associated with the Java EE platform.

Ver. 1.0

Slide 12 of 24

Business Component Development Using EJB Technologies


Examining the Java EE Application Architecture (Contd.)

The following table lists the containers, components and the


machines that host the containers.

Ver. 1.0

Container

Component Type

Container Host

EJB container

EJBs

EJB container is part of the Java EE


application server.

Web container

Servlets and
JavaServer
Pages (JSP)

EJB container is part of the Java EE


application server.

Applet
container

Applets

Applet container can be a web browser or


other application that supports the applet
programming model. The applet container is
hosted on a client machine.

Application
client
container

Application client
component

Application client container is hosted by the


client machine.

Web browser

Web pages

Web browser is hosted by the client


machine.
Slide 13 of 24

Business Component Development Using EJB Technologies


Examining the Java EE Application Architecture (Contd.)

The following figure shows the Java EE application


architecture with the inclusion of the application
function-specific components.

Ver. 1.0

Slide 14 of 24

Business Component Development Using EJB Technologies


Examining Java EE Container Services

Java EE services can be grouped into the following


categories:
Deployment-based- Deployment based services might include:
Persistence.
Transaction.
Security.
Injection.

Inherent services- Inherent services include:


Life-cycle.
Threading.
Remote object communication, such as RMI and CORBA.

Ver. 1.0

Slide 15 of 24

Business Component Development Using EJB Technologies


Examining Java EE Container Services (Contd.)

Vendor-specific functionality- Vendor-specific functionality can


include clustering, which addresses:
Scalability.
Failover.
Load balancing.

API-based services- The supporting services and APIs that are


included in the Java EE platform are:
Java DataBase Connectivity (JDBC) API for database
connectivity
JNDI API
RMI over Internet Inter-Object Request Broker (ORB) Protocol
(IIOP) and the interface definition language (IDL) for the Java
application
JavaMail API and JavaBeans Activation Framework (JAF) API
Java EE Connector Architecture
JMS API

Ver. 1.0

Slide 16 of 24

Business Component Development Using EJB Technologies


Examining Java EE Container Services (Contd.)
JMS API
JTA
Java Authentication and Authorization Service (JAAS)
Java API for XML Processing (JAXP)
Web services integration features
JMX
Timer services

Ver. 1.0

Slide 17 of 24

Business Component Development Using EJB Technologies


Examining Java EE Container Services (Contd.)

The following figure shows the accessibility of important


API-based services with Java EE containers.

Ver. 1.0

Slide 18 of 24

Business Component Development Using EJB Technologies


Examine the EJB Application Creation Process

Adhere to the following steps to create an EJB application:


1. Use your preferred object oriented methodology to analyze the
business problem.
2. Analyze the inter-tier communications requirements.
3. Use entity classes to model the persistence data.
4. Use session beans and synchronous service faade.
5. Use the JMS API and message-driven beans.
6. Create the client.
7. Assemble and package the application.
8. Deploy the server-side components.
9. Package and distribute the client.

Ver. 1.0

Slide 19 of 24

Business Component Development Using EJB Technologies


Examine the EJB Application Creation Process (Contd.)

The following figure shows the creation of Java EE


components and their assembly into Java EE modules.

Ver. 1.0

Slide 20 of 24

Business Component Development Using EJB Technologies


Comparing Java EE Application Development With Traditional Enterprise Application Development

Java EE platform:
Provides strict separation of the application components from
the general services and infrastructure.
Helps the developers to focus on the application business
logic.

Ver. 1.0

Slide 21 of 24

Business Component Development Using EJB Technologies


Comparing Java EE Application Development With Traditional Enterprise Application Development (Contd.)

The following figure shows the advantages of using


server-provided services.

Ver. 1.0

Slide 22 of 24

Business Component Development Using EJB Technologies


Summary

In this session, you learned that:


Enterprise JavaBeans (EJB) is defined as a server-side
component framework that builds enterprise-class distributed
component applications in Java.
EJB 3.0 beans are the POJO styled beans as opposed to
pre-EJB 3.0 enterprise beans that used to constitute multiple
Java classes per EJB.
The home interface and the component interface are
eliminated from EJB 3.0 enterprise bean.
Annotation, defined as the metadata, consists of the additional
definition that can be attached to an element within the code to
help further explain.

Ver. 1.0

Slide 23 of 24

Business Component Development Using EJB Technologies


Summary (Contd.)

Annotations can be applied to various elements of the Java


code such as:
Methods
Variables
Constructors
Package declarations

Java EE is the industry standard for developing portable,


robust, scalable, and secure server-side Java applications.
The Java EE component model relies on both container-based
and platform services.
Java EE services can be grouped into the following categories:
Deployment-based
Inherent services
Vendor-specific functionality
API-based services

Ver. 1.0

Slide 24 of 24

You might also like