86
J2EE FRAME WORK FOR PROJECT DEVLOPMENT by Prof. (Dr.) B.Puthal CSE,ITER

J2 EEE SIDES

  • Upload
    bputhal

  • View
    2.426

  • Download
    0

Embed Size (px)

Citation preview

Page 1: J2 EEE  SIDES

J2EE FRAME WORKFOR

PROJECT DEVLOPMENT

byProf. (Dr.) B.Puthal

CSE,ITER

Page 2: J2 EEE  SIDES

TO DAYS LECTURE CONTAINS

• EVOLUTION OF J2EE

• J2EE ARCHITECTURE

• COTAINERS AND COMPONENTS

• J2EE APIS

Page 3: J2 EEE  SIDES

COMPUTER REVOLUTIONS•Computer Applications innovating at unprecedented space

•MS Office with itsWord processing and Spread sheet became vital office tool, dramatically increased productivity in almost all offices and Industries

•Next came Network Revolution ; Computer networking bridged disparate systems giving right business soln with instant connectivity across the globe

•Introduction of Java came up de facto language of Internet with its platform independency,security,with automatic garbage collection facilities.

•Latest came J2EE platform which introduced Java to server side Enterprise computing

•With the advent of XML and new Java APIS,like JDBC,RMI,JNDI,JMS etc new platforms for Enterprise integration has arrived.Under this category comes

IBM-----WebServer BEA-----WebLogic 7.0 APPACHE----Tomcat 6.0

Page 4: J2 EEE  SIDES

ENTERPRISE APPLICATION

• An application used by more than one person conducting transactions concurrently on a unified platform for 24 hrs a day ,7days a week without any down time.Instantaneous Resource demand at office,home,on train and on board flight is common now a days.

• Uses J2EE architecture using distributed resources like DMSs across network shared with many applications

• J2EE is frame work for developing multi tiered distributed application model offering highly secured scalable web centric services

Page 5: J2 EEE  SIDES

Evolution of J2EE Architecture

• Single Tier (Monolithic code)

Presentation Logic+Business Logic +Data Access Logic

Data BaseMF

Dt

Dt

Page 6: J2 EEE  SIDES

Single Tier (Mainframe-based)

? Dumb terminals are directly connected to mainframe

? Centralized model (as opposed distributed

model)

? Presentation, business logic, and data

access are intertwined in one monolithic

mainframe application

Page 7: J2 EEE  SIDES

Single-Tier: Pros & Cons? Pros:

– No client side management is required

– Data consistency is easy to achieve

? Cons:

– Functionality (presentation, data model, business

logic intertwined), makes difficult for updates and

maintenance and code reuse

Page 8: J2 EEE  SIDES

Two Tier

When PC with comp power came,two tier thick client evolved

Presentation Logic+ Business Logic Data Access Logic

Data BaseC

C

C

S

Client/Server Architecture

Page 9: J2 EEE  SIDES

Two-Tier

Page 10: J2 EEE  SIDES

Two-Tier: Pros & Cons

? Pro:– DB product independence (compared to single-tier model)

? Cons: business logic and data access logic are intertwined (at

client side), difficult for updates and maintenance

– Data Model is “tightly coupled” to every client: If DB

Schema changes, all clients break

– Updates have to be deployed to all clients making System maintenance nightmare

– DB connection for every client, thus difficult to scale Raw data transferred to client for processing causes high network traffic

Page 11: J2 EEE  SIDES

3 Tier

presentation Business Data Access

Data BaseC

C

AplnServr

S

S

C

Data Base

Data Base

Page 12: J2 EEE  SIDES

3Tier Evolution In three tier ,client asks for resource available not in one server but in many servers and implemented in application sever.

When the Internet took off, the three tier model takes a very radical transformation in which HTML browser talks to a Web server, which then talks to backend database or enterprise information systems.

A four tier model evolved. Separating presentation logic into a separate tier diff types of presenting interfaces can access same business logic .Mobiles ,laptops can access Data base without any change in access logic.Separation of functionality allows each tier to be written by separate developer group.RAD

Page 13: J2 EEE  SIDES

Internet Formulation

S

H

H

H

ISP(L)

R RR

RR

R

R

ISP(Reg)

H H

S

S

ISP(NL)

Subnet

Home PC

Company Network

Satellite

Page 14: J2 EEE  SIDES

4-Tier J2EE

Client tier Component component component

Web Tier Component component component

EJB Tier Component component component

EIS Tier Component component component

request response

Business tier

Data access tier

COMPNENT BASED TECHNOLOGY

21

Page 15: J2 EEE  SIDES

J2ee application runs on 3 m/s

Page 16: J2 EEE  SIDES

J2EE CONTAINERSarchi

Page 17: J2 EEE  SIDES

Client Server Communications

Page 18: J2 EEE  SIDES

J2EE is End-to-End Solution

Page 19: J2 EEE  SIDES

J2EE Takes services From..

Page 20: J2 EEE  SIDES

J2EE Server

Server,Cotainer &Components

Web Container

Servlet JSP Web ServicesJa

va M

ail

JMS

JAX

PJA

AS

JND

IJD

BC

JTA

Con

nec

tors

JAX

-RP

CS

AA

JApplication Contaner

ApplicationClients

JMS

JAX

PJA

AS

JDB

C

Java

Mai

lJM

SJA

XP

JAA

SJN

DI

JDB

CJT

AC

onn

ecto

rsJA

X-R

PC

SA

AJ

AppletContainer

Applet

Database

T

Enterprise Java Beans

J2EE Jogical Architecture

EJB CONTAINER

request

response

request

response

JMS

JAX

PJA

AS

JDB

C

Business Services

Page 21: J2 EEE  SIDES

Architecture

Internet

Application

Go back

Page 22: J2 EEE  SIDES

J2EE an End to End Architecture

Page 23: J2 EEE  SIDES

Enterprise ApplicationsThings that make up an enterprise application

– Presentation logic(how client asks server & how server sends information

– Business logic(Business rules of the application)

– Data access logic (and data model)

– System services provided by CONTAINERS

The evolution of enterprise application a continuous procs

framework reflects– How flexibly you want to make changes

Page 24: J2 EEE  SIDES

J2EE Components

J2EE applications are made up of components. A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and that communicates with other components. The J2EE specification defines the following J2EE components:

•Application clients and applets are components that run on the client.

•Java Servlet and JavaServer Pages (JSP ) technology components are web components that run on the server.

•Enterprise JavaBeans (EJB ) components (enterprise beans) are business components that run on the server.

J2EE components are written in the Java programming language and are compiled in the same way a

archi

Page 25: J2 EEE  SIDES

The runtime portion of a J2EE product. A J2EE server provides EJB and web containers. Enterprise JavaBeans (EJB) container Manages the execution of enterprise beans for J2EE applications. Enterprise beans and their container run on the J2EE server. Web container Manages the execution of JSP page and servlet components for J2EE applications. Web components and their container run on the J2EE server. Application client container Manages the execution of application client components. Application clients and their container run on the client. Applet container Manages the execution of applets. Consists of a web browser and Java Plug-in running on the client together

J2EE server archi

Page 26: J2 EEE  SIDES

J2EE Connector ArchitectureThe J2EE Connector architecture is used by J2EE tools vendors and system integrators to create resource adapters that support access to enterprise information systems that can be plugged in to any J2EE product. A resource adapter is a software component that allows J2EE application components to access and interact with the underlying resource manager of the EIS. Because a resource adapter is specific to its resource manager, typically there is a different resource adapter for each type of database or enterprise information system. The J2EE Connector architecture also provides a performance-oriented, secure, scalable, and message-based transactional integration of J2EE-based web services with existing EISs that can be either synchronous or asynchronous. Existing applications and EISs integrated through the J2EE Connector architecture into the J2EE platform can be exposed as XML-based web services by using JAX-RPC and J2EE component models. Thus JAX-RPC and the J2EE Connector architecture are complementary technologies for enterprise application integration (EAI) and end-to-end business integration. j2ee

Page 27: J2 EEE  SIDES

JAAS

The Java Authentication and Authorization Service (JAAS) provides a way for a J2EE application to authenticate and authorize a specific user or group of users to run it. JAAS is a Java programing language version of the standard Pluggable Authentication Module (PAM) framework, which extends the Java 2 Platform security architecture to support user-based authorization.

Page 28: J2 EEE  SIDES

Java Naming and Directory Interface

The Java Naming and Directory Interface       (JNDI) provides naming and directory functionality. It provides applications with methods for performing standard directory operations, such as associating attributes with objects and searching for objects using their attributes. Using JNDI, a J2EE application can store and retrieve any type of named Java object. J2EE naming services provide application clients, enterprise beans, and web components with access to a JNDI naming environment. A naming environment allows a component to be customized without the need to access or change the component's source code. A container implements the component's environment and provides it to the component as a JNDI naming context. A J2EE component locates its environment naming context using JNDI interfaces. A component creates a javax.naming.InitialContext object and looks up the environment naming context in InitialContext under the name java:comp/env. A component's naming environment is stored directly in the environment naming context or in any of its direct or indirect subcontexts. A J2EE component can access named system-provided and user-defined objects. The names of system-provided objects, such as JTA UserTransaction objects, are stored in the environment naming context, java:comp/env. The J2EE platform allows a component to name user-defined objects, such as enterprise beans, environment entries, JDBC DataSource objects, and message connections. An object should be named within a subcontext of the naming environment according to the type of the object. For example, enterprise beans are named within the subcontext java:comp/env/ejb, and JDBC DataSource references in the subcontext java:comp/env/jdbc. Because JNDI is independent of any specific implementation, applications can use JNDI to access multiple naming and directory services, including existing naming and directory services such as LDAP, NDS, DNS, and NIS. This allows J2EE applications to coexist with legacy applications and systems. For more information on JNDI, see The JNDI Tutorial:

Page 29: J2 EEE  SIDES

Java Transaction API

The Java Transaction API (JTA) provides a standard interface for demarcating transactions. If your application performs two separate database access operations that depend on each other, you will want to use the JTA API to demarcate where the entire transaction, including both operations, begins, rolls back, and commits

Page 30: J2 EEE  SIDES

JDBC API

The JDBC API lets you invoke SQL commands from Java programming language methods. You use the JDBC API in an enterprise bean when you override the default container-managed persistence or have a session bean access the database. With container-managed persistence, database access operations are handled by the container, and your enterprise bean implementation contains no JDBC code or SQL commands. You can also use the JDBC API from a servlet or a JSP page to access the database directly without going through an enterprise bean. The JDBC API has two parts: an application-level interface used by the application components to access a database, and a service provider interface to attach a JDBC driver to the J2EE platform

Page 31: J2 EEE  SIDES

Java API for XML Processing JAXP

The Java API for XML Processing (JAXP) supports the processing of XML documents using Document Object Model (DOM), Simple API for XML (SAX), and Extensible Stylesheet Language Transformations (XSLT). JAXP enables applications to parse and transform XML documents independent of a particular XML processing implementation. JAXP also provides namespace support, which lets you work with schemas that might otherwise have naming conflicts. Designed to be flexible, JAXP lets you use any XML-compliant parser or XSL processor from within your application and supports the W3C schema. You can find information on the W3C schema at this

Page 32: J2 EEE  SIDES

JAF

The JavaBeans Activation Framework (JAF) is included because JavaMail uses it. JAF provides standard services to determine the type of an arbitrary piece of data, encapsulate access to it, discover the operations available on it, and create the appropriate JavaBeans component to perform those operations

Page 33: J2 EEE  SIDES

Enterprise contd-A Typical enterprise application includes

• presentation logic,

• business logic,

• data access logic,

system services provided by containers

The presentation logic deals with how to present information to the end-users.

The business logic includes the business rules of the application.

And the data access logic deals with accessing data in the back-end database.

Page 34: J2 EEE  SIDES

/

•Microsoft provides .NET Framework.Fully controlled by Microsoft supports all languages that ARE SUPPORTED BY WINDOWS

•Sun provides Platform independent J2EE,STRUT and supports single language ie.JAVA

Page 35: J2 EEE  SIDES

Java API for XML-Based RPC The Java API for XML-based RPC (JAX-RPC) uses the SOAP standard and HTTP, so client programs can make XML-based remote procedure calls (RPCs) over the Internet. JAX-RPC also supports WSDL, so you can import and export WSDL documents. With JAX-RPC and a WSDL, you can easily interoperate with clients and services running on Java-based or non-Java-based platforms such as .NET. For example, based on the WSDL document, a Visual Basic .NET client can be configured to use a web service implemented in Java technology, or a web service can be configured to recognize a Visual Basic .NET client. JAX-RPC relies on the HTTP transport protocol. Taking that a step further, JAX-RPC lets you create service applications that combine HTTP with a Java technology version of the Secure Socket Layer (SSL) and Transport Layer Security (TLS) protocols to establish basic or mutual authentication. SSL and TLS ensure message integrity by providing data encryption with client and server authentication capabilities. Authentication is a measured way to verify whether a party is eligible and able to access certain information as a way to protect against the fraudulent use of a system or the fraudulent transmission of information. Information transported across the Internet is especially vulnerable to being intercepted and misused, so it's very important to configure a JAX-RPC web service to protect data in transit.

Page 36: J2 EEE  SIDES

System Services•Services include presentation logic, business logic, data access logic, and system services.

•The presentation logic deals with how to present information to the end-users.

•The business logic includes the business logic of the application.

•The data access logic deals with accessing data in the back-end database.

•The system services includes security, caching, logging, transaction, and other services that typical enterprise application would use.Now the way the enterprise application framework evolves reflects how flexibly you want to make changes in the presentation logic, business logic and data access and data models..

Page 37: J2 EEE  SIDES

J2EE Operation

Page 38: J2 EEE  SIDES

JSP->Bean->EJB EJB -> Bean -> JSP

JavaBeans component manage the user input and send that input to enterprise beans running in the business tier for processing.

Page 39: J2 EEE  SIDES

J2EE Appln

Page 40: J2 EEE  SIDES

J2EE Components J2EE web components are : Servlets, JSP pages

J2EE business components are: Beans & EJBs

• Servlets are Java programming language classes that dynamically process requests and construct responses.

•JSP pages are text-based documents that execute as servlets but allow a more natural approach

•JavaBean component is to manage the user input and send that input to enterprise beans running in the business tier for processing

•Enterprise bean receives data from client programs and beans, processes it (if necessary), and sends it to the enterprise information system tier for storage. An enterprise bean also retrieves data from storage, processes it (if necessary), and sends it back to the client program.

Page 41: J2 EEE  SIDES

JMX ARCHITECTURE

Page 42: J2 EEE  SIDES

J2EE DEPLOYMENT SOLN

Page 43: J2 EEE  SIDES

EJB CONSTITUENTSThere are three kinds of enterprise beans: session beans, entity beans, and message-driven beans.

A session bean represents a transient conversation with a client. When the client finishes executing, the session bean and its data are gone.

In contrast, an entity bean represents persistent data stored in one row of a database table. If the client terminates or if the server shuts down, the underlying services ensure that the entity bean data is saved.

A message-driven bean combines features of a session bean and a Java Message Service (JMS) message listener, allowing a business component to receive JMS messages asynchronously

Page 44: J2 EEE  SIDES

EJB

Customer Bean

Order Bean

Shopping cartBean

Application A

Customer Bean

Order Bean

Shopping cartBean

Inventory BeanBean

Application B

Written by X

Written by Y

Enterprise beans are building blocks that can be used alone or with other enterprise beans to execute business logic on the J2EE server.

Page 45: J2 EEE  SIDES

Enterprise Computing

Page 46: J2 EEE  SIDES

What Is the J2EE?Open standard based platform

for

developing, deploying and managing

n-tier, Web-enabled, server-centric,

and component-based enterprise platform

J2EE, In short, is an open standard, development and deployment platform for building n-tier, web-based and server-centric, and component-based enterprise applications.

Page 47: J2 EEE  SIDES

Evolution of EnterpriseApplication Framework

? Single tier

? Two tier

? Three tier

? Four tier (HTML browser and Web server)

For Distributed point to point communication two technologies are involved

– RPC based

– Remote object based

Page 48: J2 EEE  SIDES

Three-Tier (RPC based)

Page 49: J2 EEE  SIDES

Three-tier (RPC based): Pros & Cons

Pro:– Business logic can change more flexibly than 2-

tier model

? Most business logic reside in the middle-tier server

?Cons:– Complexity is introduced in the middle-tier server

– Client and middle-tier server is more tightly coupled

(than the three-tier object based model)

– Code is not really reusable (compared to object

model based)

Page 50: J2 EEE  SIDES

REMOTE PROCEDURE CALL(RPC)

Main(){..Get_data()… }

Get_data(){a=b+c;….If(a=0)… }

Physical Network

RPC client software

RPC server software

Page 51: J2 EEE  SIDES

OBJECT REQUEST BROKER (ORB)

Main(){Object aa.Get_data();… }

Object a {Get_data(){a=b+c;….If(a=0)… }}

Physical Network

ORB client software

ORB server software

Page 52: J2 EEE  SIDES

Three-Tier (Remote Object based)

Page 53: J2 EEE  SIDES

Three-tier (Remote Objectbased): Pros & Cons

? Pro:

– More loosely coupled than RPC model

– Code could be more reusable

? Cons:

– Complexity in the middle-tier still need to be

addressed

Page 54: J2 EEE  SIDES

Java Message Service API

The Java Message Service (JMS) API is a messaging standard that allows J2EE application components to create, send, receive, and read messages. It enables distributed communication that is loosely coupled, reliable, and asynchronous

Page 55: J2 EEE  SIDES

Three-Tier (Web Server)

Page 56: J2 EEE  SIDES

Three-tier (Web Server based):Pros & Cons

? Pro:

– Ubiquitous client types

– Zero client management

– Support various client devices

? J2ME-enabled cell-phones

? Cons:

– Complexity in the middle-tier still need to be

addressed

Trends

? Moving from single-tier or two-tier to multitier

architecture

? Moving from monolithic model to objectbased

application model

? Moving from application-based client to

HTML-based client

So based on this evolution, we can observe a few trends. First, moving from a

single tier or two-tier model to multi-tier model. Second, moving from the

monolithic code to object-based application model. Lastly, HTML browser

based clients are taking some strong hold.

03/19/2007

Page 57: J2 EEE  SIDES

Web Server based:Pros & Cons

Trends

? Moving from single-tier or two-tier to multitier architecture

? Moving from monolithic to objectbased application model

? Moving from application-based client to HTML-based client

Page 58: J2 EEE  SIDES

Distributed Computing Environment

S

C

C

C

C

S

C

C

C

AplnS

S

S

SSingle tier

Two tier

Three tier

Page 59: J2 EEE  SIDES

HTML file with the embedded with jsp executes remotely in the server and results sent to user imn html page

Java Script/JS in HTML pages

client Server

HTML file

URL HTTPRequests with…

Web serverWeb Browser URLs that address other Web services

(telnet malito etc)

HTML file with the embedded Java script executes locally with the browser and interacts with the user

Urls that address the scriptincluding jsp asp

Script

Scipt receives browser info performs required processing and returns rersults to browser.(Dynamic web page)user

script/jsp

Files accessible to servers

url addressing these files (static webpages)

Page 60: J2 EEE  SIDES

Server Side Computing…

• Basically Internet application are based on Client/Server architecture and Java with its net centric features has evolved as de facto language of Internet.

• Sun’s J2EE &BEA Web Logic server introduced Java intensively to server side Enterprise computing

Page 61: J2 EEE  SIDES

61SIMPLE J2EE

Model II Architecture

Page 62: J2 EEE  SIDES

Monolithic vs. Object-based

Page 63: J2 EEE  SIDES

J2EE 1.4 APIs and Technologies? J2SE 1.4 (improved)

? JNDI Java Naming and Directory Services

? JMX 1.1 Api for XML mesage ? J2EE Deployment

? JMS 1.1 Java Messaging Services

? JTA 1.0 Java Transactions ? JSP 2.0 Servlet 2.

? JavaMail 1.3 ? EJB 2.1

? Connector 1.5 For Main frame ,ERP and Legacy Systems

? JACC Java Authentication .

? JAF 1.0 Java Bean Aithentication Framework

? JAXP 1.2 For XML Processing

Page 64: J2 EEE  SIDES

Container & ComponentsAs for the relationship between components and containers, as you might have guessed it, the components are running within containers. That is, the containers provides the host execution environments for the components. The types of components within J2EE environment are •Client components that are running on client either as a stand-alone or applet

• JSP or servlet as web components running inside webtainer

•EJB beans as business components running inside EJB container And developers are responsible for the implementation of these components. On the other hand, the containers are provided by the platform vendors

•. Containers provide runtime system services such as life-cycle management of the components, transaction coordination, persistence management, resource pooling The containers are also responsible for providing the APIs,and the distributed communication protocols, shown in brown In a typical multi-tier, thin client enterprise application, most of the development effort will be focused on building web-tier components at web-tier and enterprise Java beans at EJB tier..

Page 65: J2 EEE  SIDES

j

Page 66: J2 EEE  SIDES

Java Mail API

J2EE applications use the JavaMail API to send email notifications. The JavaMail API has two parts: an application-level interface used by the application components to send mail, and a service provider interface. The J2EE platform includes JavaMail with a service provider that allows application components to send Internet mail

Page 67: J2 EEE  SIDES

What are Java Servlets?Servlets are Java technology's answer to CGI programming. They are programs that run on a Web server and build Web pages on the fly.

•The Web page is based on data submitted by the user. For example the results pages from search engines are generated this way, and programs that process orders for e-commerce sites do this as well.

•The Web page uses information from corporate databases or other such sources. For example, you would use this for making a Web page at an on-line store that lists current prices and number of items in stock.

Page 68: J2 EEE  SIDES

SERVLET FEATURES

Page 69: J2 EEE  SIDES

Advantages of Servlet Over "Traditional" CGI

Java servlets are more efficient, easier to use, more powerful, more portable, and cheaper than traditional CGI .

•Efficient. In traditional CGI, a new process is started for each HTTP request. With servlets, the Java Virtual Machine stays up, and each request is handled by a lightweight Java thread, not by heavyweight operating system process as in traditional CGI, if there are N simultaneous request to the same CGI program, then the code for the CGI program is loaded into memory N times. With servlets, however, there are N threads but only a single copy of the servlet class.

•Convenient. A servlet is a java class ,so it has an extensive infrastructure for automatically parsing and decoding HTML form data, reading and setting HTTP headers, handling cookies, tracking sessions, and many other such utilities.

•Powerful. Java servlets harness full power of Java like networking,URL accessing multithreading,object serialisation and RMIetc

• Servlets can also share data among each other, making useful things like database connection pools easy to implement. They can also maintain information from request to request, simplifying things like session tracking and caching of previous computations.

•Portable. Servlets are written in Java and follow a well-standardized API. Consequently, servlets written for, say I-Planet Enterprise Server can run virtually unchanged on Apache, Microsoft IIS, or WebStar. Servlets are supported directly or via a plugin on almost every major Web server.

•Inexpensive.

Page 70: J2 EEE  SIDES

JSP and itsAdvantages

Java Server Pages (JSP) is a technology that lets you mix regular, static HTML with dynamically-generated HTML. Tag based language.

•JSP can do every thing that in principle , a Servlet does .

• But it is more convenient to write (and to modify!) regular HTML than to have a zillion println java statements that generate the HTML.

•Plus, by separating the look from the content you can put different people on different tasks: your Web page design becomes RAD

Page 71: J2 EEE  SIDES

Lifecycle of a JSP

CLient

Web ServerRequest

Response

<HTML></HTML>

JVM<%b&ya;; a 012(*2….

JSP compiler

First call of this JSP

<%page language…%><HTML>…</HTML>

Subsequent calls to this JSP

service() method of the servlet.is called.which already inside

Compile the JSP into a temporary servlet

The servlet now needs to be compliled.

ImportPublic class…

Servlet compilerBytecode

Page 72: J2 EEE  SIDES

J2EE ConstituentsJava 2 Platform, Enterprise Edition: A platform from Sun for building distributed enterprise applications.

J2EE services are performed in the middle tier between the user's machine and the enterprise's databases and legacy information systems.

Its core components are1. JavaServer Pages (JSPs) and 2. Java servlets and a variety of interfaces for linking to the information resources in the enterprise.3. Enterprise JavaBeans (EJBs),

J2EE APIsinclude • JDBC for databases, • JNDI for directories,• JTA for transactions, • JMS for messaging,• JavaMail for e-mail systems and • IDL for CORBA connectivity.

J2EE Constituents

Page 73: J2 EEE  SIDES

EJB

Page 74: J2 EEE  SIDES

Web Tier and J2EE Applications

the web tier includes JavaBeans components to manage the user input and send that input to enterprise beans running in the business tier for processing.

Page 75: J2 EEE  SIDES

Business and EIS Tiers

Enterprise bean receives data from client programs, processes it (if necessary), and sends it to the enterprise information

system tier for storage. An enterprise bean also retrieves data from storage, processes it (if necessary), and sends it back to

the client program

Page 76: J2 EEE  SIDES

Java Mail : AP enables Java Mail programmers / Clients to communicate by sending e-mail message use order confirmation.

JMS : Java Message Service allows components to send and release asynchronous messages provides their own API for messages. API is used to build into Java Programmes a trans message link between components.

JAXP : API supports passing of XML documents using DOM (Document Object Model). A simple API for XML style sheet language for transformation (XSLT).

JAAS : API provides security (Java Authentication and Authentication) Imposes authentication and authorization checks on users.

JNDI : API provides directory service by which J2EE components can be requested and discovered. Objects can be locates in various on servers. API provides standout namely conventions so that programmers can look up objects from Java programs.

JDBC : API enables programmes to connect to and interact when practically all databases.

VARIOUS APIS IN J2EE

Page 77: J2 EEE  SIDES

J2EE APISBuilding Multier Applications

Client

EJB

ServletJSP

JNDI

JTAJTS

DataDase

Application Sever

Tag Lib using XML DataDase

Page 78: J2 EEE  SIDES

MVC Architecture

Client

DataDase

ModelView Controller Architecture

DataDase

Controller(Servlet)

Req processData validation

ModelBusiness Logic

Data Manipulation

View (JSP)Response Generation

Page 79: J2 EEE  SIDES

Model I -Architecture

Session EJB Servlet or JSP Client

EntityEJB

DB

request

response

A single Servlet or JSP processes a HTTP request

Page 80: J2 EEE  SIDES

MVC…

• MVC is suitable for Web development• MODEL:Seperates View from contoller

provides Interface to Data access and manipulation (Java Beans,Entity EJB)

• VI|EW:Uses any viewing technology like (HTML,JSP)

• CONTROLLER:Receives requests from application manages flow of data between model layer and view layer uses SERVLET

Page 81: J2 EEE  SIDES

Model II Architecture

Servlet

DB

request

response

Once servlet has verified HTTP request and obtained necessary data to formulate response,request is forwarded to a JSP for generating a web page whichis returned to client as response .

Client Session EJB

EntityEJB JSP

Request forwarded

contoller

view

Page 82: J2 EEE  SIDES

Type 1: JDBC-ODBC Bridge driver

Page 83: J2 EEE  SIDES

Type 2: Native-API/partly Java driver

Page 84: J2 EEE  SIDES

Type 3: All Java/Net-protocol driver

Page 85: J2 EEE  SIDES

PROJECT DEVELOPMENT TIPS

•Know Core Java Then learn J2EE components ie. JSP,Servlet and Java APIs like JDBC,RMI,JNDI etc

•Learn OOAD for Translating complex business requirements to reusable objects

•For client side front end design ,learn a web editor like Front Page,Dream weaver.For this learn HTML,Java script for DHTML

• For server side interaction,learn JSP and Servlet,Java Beans and EJB.Also XML for B2B communication

•Learn communication protocols like HTTP,TCP/IP,DNS programming using sockets,ports an Java APIs

Page 86: J2 EEE  SIDES