18

Click here to load reader

J2ee and web services

Embed Size (px)

Citation preview

Page 1: J2ee and web services

J2ee and Web Services

JAVA PLATFORMS

•J2SE – Java 2 Standard Edition Java for the desktop / workstation•

•J2ME – Java 2 Micro Edition Java for the consumer device

•J2EE - Java 2 Enterprise Edition Java for the server

Page 2: J2ee and web services

J2ee and Web Services J2ee J2se J2me

Page 3: J2ee and web services

J2ee and Web Services

J2EE Supports

• Extensible Markup Language

• Web Applications

• Web Services Support / WSDL Standard

Format

• UDDI and ebXML Standard Formats

• HTTP-SOAP Transport Protocol

Page 4: J2ee and web services

J2ee and Web Services

•J2EE comes with a built in application server

•J2EE defines Java API for XML Processing (JAXP) API for processing XML

•Uses SAX and DOM standards

Page 5: J2ee and web services

J2ee and Web Services•J2EE does not specify the nature and structure of the runtime.

•J2EE Container – capability of the runtime to manage application components.

•J2EE APIs specifies the contract between the applications and the container.

Page 6: J2ee and web services

Web Container

RM

I/II

OP

JND

I

JTA

JAF

JDB

C

Java

Mai

l

JMS

Servlets JSPs

EJB Container

RM

I/II

OP

JND

I

JTA

JAF

JDB

C

Java

Mai

l

JMS

Session Beans Entity Beans

J2EEApplication

Server

HTML/XML

Applet

ClientApplica-

tion

JDBC

JavaMail

RMI

IIOP

JNDI

JMS

RDBMS

Mail Server

CORBA

Directory Services

Client Application Logic

Data

J2EE Architecture

Page 7: J2ee and web services

•The Component technologies – to hold the business logic. (JSP, Servlets and EJB)

•The Service technologies – to provide supported services to application components (JDBC, JTA, JNDI)

•The Communication technologies – transparent to appln programmer, provide the mechanism for communication among different parts of the appln. (JMS, JavaMail, RMI-IIOP)

•They are re-usable software units containing business logic.

• An EJB is just a collection of Java classes and an XML file, bundled into a single unit.

J2ee and Web Services

Page 8: J2ee and web services

• They are re-usable software units containing business logic.

• An EJB is just a collection of Java classes and an XML file, bundled into a single unit.

• Java classes must follow certain rules and provide certain callback methods.

Enterprise Java Beans

Page 9: J2ee and web services

• Session Beans

• Entity Beans

• Message-driven Beans

Different kinds of EJB

Page 10: J2ee and web services

• Intended for the use of a single client.

• Lifespan is limited to that of its client.

• When the client leaves the web site or the application is shut down, the session bean disappears.

Session Beans

Page 11: J2ee and web services

Can keep information on behalf of its client across method calls.

For example,

Full information of the client is stored in every transactions example , credit card

StateFul Session Beans

Page 12: J2ee and web services

Stateless Session Beans

• This bean implements a particular business logic, though its created for a particular client, it doesn’t have to remember anything about the client.

• Can be considered as a remote procedure that gets executed on behalf of the client, taking some parameters and returns the result (of calculation in a particular business rule context).

Page 13: J2ee and web services

•Persistence is its basic property.

•It stays around even after the program is terminated until it is deleted.

•When the program is restarted, it can gain access to this bean again.

•It can be used by any program on the network.

•It is executed remotely.

•It is identified by a primary key.

•Its nothing but the object representation of records in RDBMS tables.

Entity Beans

Page 14: J2ee and web services

Advantages

• J2EE provides a complete architecture for developing

- Distributed systems including object persistence, session tracking, transaction management, …

•Separation of technical and application-specific code

- Deployment descriptors - Container Managed Persistence

J2ee and Web Services

Page 15: J2ee and web services

Disadvantages

• Very complex technology Even simple examples require many interfaces, bean classes, deployment descriptors.• Many errors occur only at runtime (several steps required until the application is running)- Compilation- Packaging- Deployment- Running the application

J2ee and Web Services

Page 16: J2ee and web services

A Web Application Framework (WAF) is a reusable, skeletal, semi-complete modular platform that can be specialized to produce custom web applications , which commonly serve the web browsers via the Http's protocol.

WAF usually implements the Model-View-Controller (MVC) design pattern, typically in the Model 2 architecture to develop request-response web-based applications on the Java EE and .NET models.

Web application framework

Page 17: J2ee and web services

Model View Controller

Page 18: J2ee and web services

Web Aplication Framework

Request-based Framework : Struts WebWork Beehive , Stripes

Component-based FrameworkJave Server Faces (JSF)TapestryWicket

Hybrid – Meta Framework RIFESpring Framework

RIA-based Framework DWREcho2JSON-RPC-Java