enterprise java beans. model 1 j2ee – web view model/view/controller model view control data base...

13
Enterprise Java Beans

Upload: betty-mills

Post on 05-Jan-2016

221 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

Enterprise Java Beans

Page 2: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

Model 1 J2EE – Web View

Model/View/Controller

Model View

ControlDatabase

WebServer

Model One

Architecture

HTTP Request

HTTP Response

Page 3: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

Model 1 J2EE – Other Views

Model/View/Controller Model One

Architecture

REWRITE!!! Database

Page 4: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

View

Model 2 J2EE – Other Views

Control Model

EntityBean

Session Bean

Model Two

Architecture

REWRITE!!!

Page 5: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

EJB ContainerWeb Container

View

Model 2 with J2EE EJB’s

Control Model

WebServer

Session EJB

Model Two Architecture

JavaBean

Entity EJB

Request Handler

BuildView

Servlet

JSP page

JavaBean

<<forward>>

HTTP Request

HTTP Response

Page 6: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

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 7: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

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 8: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

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 9: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

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 10: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

The EJB Pool

EJBContainer

ClientServlet/JSP

ClientApplet

ClientSwing App

ClientB-to-B

EJB1EJB2

EJB2

EJB2

EJB2

EJB2

Server

EJB Pool

EJB2

Page 11: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

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 12: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

ClusteredServers

Clustering of EJB Servers

ClientServlet/JSP

ClientApplet

ClientSwing App

ClientB-to-B

EJB2

EJB2

EJB4

EJB3

EJB2

EJB4

EJB2

EJB3

Page 13: Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP

Deploy Model 2 with EJBs

View Layer Control & Model Layer