Upload
woods
View
28
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Enterprise Java Beans. Model One Architecture. Data base. Model 1 J2EE – Web View. Model/View/Controller. Web Server. HTTP Request. CGI/SERVLET/PHP. HTTP Response. Model One Architecture. Data base. Model 1 J2EE – Other Views. Model/View/Controller. REWRITE!!!. Model 2 Without EJBs. - PowerPoint PPT Presentation
Citation preview
Enterprise Java Beans
Model 1 J2EE – Web View
Model/View/Controller
CGI/SERVLET/PHP
Database
WebServer
Model One
Architecture
HTTP Request
HTTP Response
Model 1 J2EE – Other Views
Model/View/Controller Model One
Architecture
REWRITE!!! Database
View
Model 2 Without EJBs
Control Model
Model <<POJO>>
Control<<POJO>>
WebServer
Model Two
Architecture
Request handler
Build view
HTTP Request
HTTP Response
EJB ContainerWeb Container
View
Model 2 with J2EE EJB’s
Control Model
Session BeanWeb
Server
Servlet
JSP page
Session EJB
Model Two Architecture
JavaBean
JavaBean
Entity EJB
<<forward>>
HTTP Request
HTTP Response
Entity EJB
JavaBean
<<creates>>
View
Model 2 J2EE – Other Views
Control Model
EntityBean
Session Bean
Model Two
Architecture
REWRITE!!!
Model 2 J2EE Architecure
WebServer
View
Control Model
Model <<Entity EJB>>
Control<<Session EJB>>
Model Two
Architecture
Response
Request
<<forward>>
Servlet
JSP page
Deploy Model 2 with EJBs
View Layer Control & Model Layer
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
Multiple apps share common data repository
Must support transactions
You need fine grained security (functional level)
High Scalability
High Availability
Must support multiple clients
When should I Use J2EE Model 2?
Java Beans vs. Enterprise Java Beans
Java Beans Enterprise Java Beans
General purpose component
A single class
Executed and used anywhere
Highly specialized business logic components
Collection of classes based on patterns
Executed only in an enterprise container
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
The EJB Pool
EJBContainer
ClientServlet/JSP
ClientApplet
ClientSwing App
ClientB-to-B
EJB1EJB2
EJB2
EJB2
EJB2
EJB2
Server
EJB Pool
EJB2
Swapping in EJB Pool
ClientServlet/JSP
ClientApplet
ClientSwing App
ClientB-to-B
EJB1EJB2
EJB2
Server
EJB Pool
EJB4
EJB3
EJB5
EJB3
EJB4
EJB5
EJB3
EJB4 EJB5
EJBContainer
EJB2EJB2
ClusteredServers
Clustering of EJB Servers
ClientServlet/JSP
ClientApplet
ClientSwing App
ClientB-to-B
EJB2
EJB2
EJB4
EJB3
EJB2
EJB4
EJB2
EJB3