AN INTRODUCTION TO ENTERPRISE APPLICATION DEVELOPMENT USING EJBs by SHREERAM IYER 08/29/2001 - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

AN INTRODUCTION TO ENTERPRISE APPLICATION DEVELOPMENT USING EJBs by SHREERAM IYER 08/29/2001

Description:

Helps create portable and scalable solutions. Provides for vendor-specific enhancements ... Raw execution environment. Multiprocessing. Load balancing. Naming ... – PowerPoint PPT presentation

Number of Views:79
Avg rating:3.0/5.0
Slides: 23
Provided by: chinta
Learn more at: https://sse.umkc.edu
Category:

less

Transcript and Presenter's Notes

Title: AN INTRODUCTION TO ENTERPRISE APPLICATION DEVELOPMENT USING EJBs by SHREERAM IYER 08/29/2001


1
AN INTRODUCTION TO ENTERPRISE APPLICATION
DEVELOPMENT USING EJBsbySHREERAM IYER08/29/2001
2
Why is Enterprise Application Development
different and complex?
  • Done using components and component technology
  • When a component fails, ensure faults are
    isolated and that it does not corrupt others
  • In a distributed application, components can
    reside anywhere on the network
  • Enterprises are essentially heterogeneous
    environments with presence of multiple Operating
    Systems

3
What is EJB?
  • EJB (Enterprise Java Beans)
  • EJB is a server component model for Java
  • Specification for creating server side, scalable,
    transactional, multi-user and secure
    enterprise-level applications
  • Provides a consistent component architecture for
    creating distributed n-tier middleware

4
Why EJBs?
  • Frees application developer to concentrate on
    programming only the business logic
  • Removes the need to write all the plumbing code
    required in any enterprise application
    development scenario
  • Clients become thin as they have to worry only
    about presentation logic
  • EJBs containing the business logic are platform
    independent
  • Support for readymade components
  • WORA for Server side components

5
Why EJBs?
  • EJB establishes roles for Application development
  • EJB takes care of Transaction Management
  • Helps create portable and scalable solutions
  • Provides for vendor-specific enhancements

6
JavaBeans and EJBs DeMystified
  • In a nutshell, JavaBeans are Java classes with
    accessor methods
  • Much smaller than EJBs
  • Do not need a runtime environment like an
    Application Server
  • A JavaBean can be a visual component
  • JavaBeans are like ActiveX components

7
EJB Architecture
EJB Architecture
8
EJB Architecture
  • Basic EJB Architecture consists of
  • An EJB Server
  • EJB Containers that run within the Server
  • Home Objects, Remote EJBObjects and Enterprise
    Beans that run within Containers
  • EJB Clients
  • Auxiliary systems JNDI, JTS and security services
  • The idea of the EJB architecture is the Server
    and the Container are responsible for providing
    the hard stuff (transactions, persistence,
    pooling, multiple instances, security, etc.)

9
EJB Servers
  • Analogous to the CORBA ORB
  • Provides Systems services like
  • Raw execution environment
  • Multiprocessing
  • Load balancing
  • Naming
  • Transaction Services

10
EJB Containers
  • Interface between EJB and outside world
  • Client never accesses a bean directly
  • Session containers contain transient,
    non-persistent EJBs whose states are not saved
  • Entity containers contains persistent EJBs
    whose states are saved between invocations

11
Home Interface and Home Object
  • Factory methods for locating, creating and
    removing instances of EJB classes
  • Home Object is the implementation of the Home
    Interface
  • EJB Developer defines the Home Interface for his
    Bean
  • The EJB Container Vendor provide tools that
    automatically generate the implementation code
    for the Home Interface as defined by the EJB
    Developer

12
Remote Interface and EJBObject
  • The Remote Interface lists the business methods
    available for the EJB
  • The EJBObject is the Clients view of the EJB and
    implements the Remote Interface
  • The EJB Developer defines the RI
  • The Container Vendor provides tools to generate
    implementation code for EJBObject
  • The Client invokes the EJBObjects methods
  • The EJB Container first handles the request
    before delegating it to the EJBprovides features
    of EJB like transaction, pooling, security, etc.

13
Naming Services and JNDI
  • A Naming Service is a dedicated piece of software
    that manages a naming system or namespace
  • JNDI is a client API that provides naming and
    directory functionality
  • Specified in JAVA
  • Designed to provide a common interface for
    accessing existing services like DNS, NDS, LDAP,
    CORBA or RMI
  • Provides an interface that hides the
    implementation details of different naming and
    directory services behind the JNDI API

14
Types of EJBs
  • EJBs can be transient or persistent
  • Two types of Enterprise Beans
  • Entity Beans Generally used to model a business
    entity
  • Session Beans General purpose server side beans

15
Entity Beans
  • Represent data in a domain model
  • Persistent Entity Bean
  • Container managed persistence
  • Bean managed persistence
  • Entity beans can share access from multiple users
  • Can survive EJB server crashes

16
Session Beans
  • Created by a client and in most cases, exists
    only for the duration of a single session
  • Stateless Session beans
  • Stateful Session beans
  • Execute on behalf of a single client
  • Relatively short-lived
  • May be destroyed when EJB Server crashes
  • Do not represent data stored in DataBase

17
The Whole EJB Picture
18
Modeling using Session and Entity Beans
  • Use Session beans for application logic
  • Use Session beans as the only interface to the
    client
  • Expect little reuse of Session beans
  • Use Session beans to control the workflow of a
    group of entity beans eg. Credit Card Validation

19
Modeling using Session and Entity Beans
  • Use Entity beans to develop a persistent object
    model
  • Use Entity beans to enforce accuracy / integrity
    of your database
  • Insist on reuse of Entity beans
  • Use Entity beans to model domain objects with a
    unique identity shared by multiple clients eg.
    Employees

20
An Enterprise Application
21
Drawbacks of EJBs
  • Developer needs to know JAVA
  • EJBs are not allowed to access native libraries
    written in C/C
  • EJBs cannot be used to develop any kind of GUI
  • Learning curve and understanding of different
    technologies involved

22
Useful links
  • http//www.ejbportal.com/
  • http//www.c2.com/cgi/wiki?EjbRoadmap
  • http//www.mgm-edv.de/ejbsig/ejbsig.html
  • http//www.jdance.com/ejb.shtm
  • http//www.sys-con.com/java/index2.html
  • http//www.nordija.com/beanbuilder/
  • http//www.ejbnow.com/
  • http//www.theserverside.com
  • http//www.beasys.com/support/newsgroup.html
  • http//www.ejbean.com
Write a Comment
User Comments (0)
About PowerShow.com