15
Enterprise Java Beans

Enterprise Java Beans

  • Upload
    woods

  • View
    28

  • Download
    1

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

Page 1: Enterprise Java Beans

Enterprise Java Beans

Page 2: Enterprise Java Beans

Model 1 J2EE – Web View

Model/View/Controller

CGI/SERVLET/PHP

Database

WebServer

Model One

Architecture

HTTP Request

HTTP Response

Page 3: Enterprise Java Beans

Model 1 J2EE – Other Views

Model/View/Controller Model One

Architecture

REWRITE!!! Database

Page 4: Enterprise Java Beans

View

Model 2 Without EJBs

Control Model

Model <<POJO>>

Control<<POJO>>

WebServer

Model Two

Architecture

Request handler

Build view

HTTP Request

HTTP Response

Page 5: Enterprise Java Beans

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>>

Page 6: Enterprise Java Beans

View

Model 2 J2EE – Other Views

Control Model

EntityBean

Session Bean

Model Two

Architecture

REWRITE!!!

Page 7: Enterprise Java Beans

Model 2 J2EE Architecure

WebServer

View

Control Model

Model <<Entity EJB>>

Control<<Session EJB>>

Model Two

Architecture

Response

Request

<<forward>>

Servlet

JSP page

Page 8: Enterprise Java Beans

Deploy Model 2 with EJBs

View Layer Control & Model Layer

Page 9: Enterprise Java Beans

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

Page 10: Enterprise Java Beans

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?

Page 11: Enterprise Java Beans

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

Page 12: Enterprise Java Beans

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

Page 13: Enterprise Java Beans

The EJB Pool

EJBContainer

ClientServlet/JSP

ClientApplet

ClientSwing App

ClientB-to-B

EJB1EJB2

EJB2

EJB2

EJB2

EJB2

Server

EJB Pool

EJB2

Page 14: Enterprise Java Beans

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

Page 15: Enterprise Java Beans

ClusteredServers

Clustering of EJB Servers

ClientServlet/JSP

ClientApplet

ClientSwing App

ClientB-to-B

EJB2

EJB2

EJB4

EJB3

EJB2

EJB4

EJB2

EJB3