Enterprise Java Beans - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Enterprise Java Beans

Description:

POJO Web. Server. Model. Two. Architecture. Output. Input forward Servlet. JSP page ... Application servers provide common underlying infrastructure (security, ... – PowerPoint PPT presentation

Number of Views:84
Avg rating:3.0/5.0
Slides: 19
Provided by: evon1
Category:
Tags: beans | enterprise | java | pojo

less

Transcript and Presenter's Notes

Title: Enterprise Java Beans


1
Enterprise Java Beans
2
Model 1 J2EE - JSP/Servlets Only
Model/View/Controller
WebServer
JSP page
Servlet
3
Model 2 Without EJBs
Model TwoArchitecture
View
WebServer

Control
Model
JSP page
Model ltltPOJOgtgt
ControlltltPOJOgtgt
Servlet
4
Deploy Model 1 without EJBs
5
Model 2 J2EE - EJBs
Model TwoArchitecture
View
WebServer

Control
Model
JSP page
EntityBean
Session Bean
Servlet
6
Deploy Model 2 with EJBs
7
Main idea behind EJBs
Encapsulate business logic and business data
  • Application servers provide common underlying
    infrastructure (security, transaction management,
    persistence, communication, etc.)
  • Provide means to create reusable components that
    can be shared across platforms
  • Standard blueprint (architecture) for
    implementation Enterprise Java applications
  • Decouple development, assembly and deployment

8
EJB Benefits
  • Flexibility, Scalability and Adaptability
  • Design based on best practices (design patterns)
  • Facilitates communication (common framework)
  • Reusability
  • More robust solutions and saves development time
  • Security
  • Transaction management
  • Concurrency control
  • Resource management
  • Persistence
  • Operating environment handling
  • Error handling

9
When should I Use J2EE Model 2?
  • Multiple sources need to concurrently access and
    update data
  • The application is transaction based
  • You need fine grained security (i.e., restrict
    access to functionality at the class level)
  • You need to scale your application to a large
    number of users
  • High availability is required (little down time)
  • To support multiple client types
  • (e.g., PDA, browser, java application)

10
Model 1 J2EE Web View
Model/View/Controller
WebServer
JSP page
Servlet
11
Model 1 J2EE Other Views
Model/View/Controller
REWRITE!!!
12
Model 2 J2EE Web View
Model TwoArchitecture
WebServer

View
Control
Model
Output
JSP page
EntityBean
Session Bean
Input
Servlet
13
Model 2 J2EE Other Views
Model TwoArchitecture

Control
Model
View
EntityBean
Session Bean
REWRITE!!!
14
Java Beans vs. Enterprise Java Beans
Java Beans
Enterprise Java Beans
  • General purpose component
  • Highly specialized business logic components
  • Collection of classes based on patterns
  • A single class
  • Executed and used anywhere
  • Executed only in an enterprise container

15
Three types of EJBs
  • Session beans control/business logic and
    transaction management (Control)
  • Entity beans to access data objects (database,
    file system, etc.) (Model)
  • Message beans to communicate with other
    applications

16
EJB Model
EJB2
EJB2
EJB1
EJBContainer
EJB Pool
Server
17
EJB Model
EJB1
EJB2
EJB2
EJBContainer
EJB3
EJB3
EJB Pool
EJB4
EJB4
EJB5
EJB5
Server
18
EJB Model
EJB3
EJB2
EJB4
Write a Comment
User Comments (0)
About PowerShow.com