24-07-2014, 09:45 AM
EJB Overview
EJB Overview.pdf (Size: 1.06 MB / Downloads: 15)
Agenda
● What is and Why EJB?
● EJB Architecture
● Component and Container Architecture
● Types of Beans
– Session beans, Entity beans, Message-Driven Beans
● Roles
● Anatomy of a EJB module
● How client invokes methods of EJB
● RMI communication model
● Deployment Descriptor & Packaging
What is EJB? (From EJB Spec.)
● “The Enterprise JavaBeans architecture is a
component architecture for the development
and deployment of component-based
distributed business applications."
● “Applications written using the Enterprise
JavaBeans architecture are scalable,
transactional, and multi-user secure."
● “These applications may be written once,
then then deployed on any server platform
that supports the Enterprise JavaBeans
specification.
EJB applications are Loosely
Coupled
● Support the integration of components
from different vendors
● EJBs refer to other components and
services to which they have access by
arbitrary names
● EJB can be authored without a detailed
knowledge of the environment
● Applications can be assembled from
separate components
Enterprise JavaBeans
● Defined as business logic ONLY
● No low-level plumbing
● Reusable across multiple EJB
Servers
● Implement interfaces that allow
container to manage them
Roles
● Distinct roles in the application
development and deployment life cycle
– EJB Bean Provider (Component provider)
– Application Assembler
– Deployer
– EJB Server Provider
– Container Provider
– System Administrator
– Tool provider
Home Interface
● Defines methods for creating, finding
and removing beans
– Factory interface
● Implemented by Container
– EJB home object
● Client gets “reference to stub object of
the EJB home object” via JNDI
● Can be remote or loca
Recommendations
● Use local interface whenever possible
– Create islands of local components (local entity
beans and their dependent objects)
● Use facade pattern in which a remote
interface session bean (for synchronous
operations) or message driven bean (for
asynchronous calls) invokes local entity
beans
● Use remote interface for loose coupling