Greet the sun all,

I was looking at the archives concerning ideas/discussions on JSP facades.
By this I mean, I have a JSP that must interact with some backend process.
This could be an EJB bean, an CORBA server, an RMI class, JMS Messaging
Engine, etc.  Now, I don't want to expose the backend process to the JSP so
I go through a Facade/or Adapter class.

I read the thread entitled JSP/Servlet Architecture that was held back in
October and was particullary intrigued by Craig McClanahan reponses.  In
that thread, a servlet acted as a facade to the backend resource.  I did not
find any threads discussing the merits of using servlets/Java beans acting
as the facade class.

Let's start with an example:

There is a backend process that does a whole lot of work when a user logs
onto a e-commerce site like Amazon (yes, I know you don't log on).
Transaction Ids are generated, shopping carts are built or previous shopping
carts retrieved, etc.  This process may have a complex API.

The discovery of this process/object is done through JNDI, COS Naming, RMI
Registry, or LDAP.  All the code necessary to connect to a directory
service, recover the reference and process the request is held in the
Facade.

Some parameters are sent and a response if given back.

Looking at the two choices (please point out if there is a third option in
this JSP < ??? (which is the Facade/Adapter) < backend process scenario), I
see the Servlet option providing:

- HTTP protocol (if firewalls are a pesky problem)
- Allow non-JSP applications access to the backend processes in a
distributed environment

However, some problems I saw was in terms of flexibility. I can pass simple
attributes and perform some function in a servlet but it is not the same as
calling a specific method in a JavaBean, passing complex parameters.

Now, JavaBeans offer flexibility, what seems like a finer level of control
in the conversation between a JSP and JavaBean.  However, I could not find a
good conversation in terms of threading issues and JSP which could be a
problem in a high-traffic site.

In addition, in a distributed environment, I would have to make sure these
JavaBean helper classes were available to any non-JSP application that
needed access to my backend process.

Thoughts?

Perry Hoekstra

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to