Girish Haran replied directly to me, but I think his comments were intended
for the list generally, so I'm hoping he won't mind if I forward them.

Let me add a public "thank you" to Girish and Dan Lopez for their insights.
(And probably to the ACIteam and Carlos for asking in the first place.)

-----Original Message-----
From:   Girish Haran [SMTP:[EMAIL PROTECTED]]
Sent:   Monday, October 25, 1999 12:11 PM
To:     Macias, Chris
Subject:        Re: when to use Bean !!!

I would differentiate along the following lines

Servlets are to be viewed as the Java based mechanism for providing dynamic
(data-enabled) Web content. They provide functionality equivalent to the
original
CGI model and object  model for servlets make it very easy for Java
developers to
do Web developement. THe downside to servlets was that the HTML has to be
scripted
inside the Java methods that are called from doGet() or doPost(). This is a
laborious task and one that is not amenable to efficient Web development.
The HTML
designers do their bit and then the Java developers have to duplicate a lot
of the
effort to script the HTML in Java

JSP ( which is based on the servlet model ) solves this problem by allowing
Java to
be embedded into HTML generated by any standard mechanisn ( text-editor,
Dreamweaver, FrontPage etc. ). The development workflow is greatly
optimized, at
least in theory. The HTML designers create the HTML and then data enable
the pages
by embbeding some minimal ammount of Java. JavaBeans provide the
simplification
that the HTML designer are probably looking for. They hold on to the data
and can
be tied to form elements on the JSP page. The JSP pagecompiler
automatically uses
introspection to figure out which methods to call on the bean for setting
and
getting data.

Given the above interaction between JSP and JavaBeans, it should be
apparent that
JavaBeans should be properly designed to serve the needs to the JSP pages
dependent
on them. This is a classic object modelling task.

EJB are quite a different beast. Many JSP implementation ( like the one I
use,
Weblogic )do not have direct support for EJB yet. The EJB framework allow
the Java
developers to robustly model business objects without necessarily worrying
too much
about the various systems aspects of the design i.e. concurrency, DB
connection
pooling, instance pooling, security, transactional capabilities etc. Again
this is
a spec that EJB vendors need to abide by. Different implementation of EJB
can
differ in terms of what they support. Typically, EJBs are created and
dropped into
"EJB containers" for deployment. The containers provide all the extra
systems
support for the objects at runtime

In terms of using JSP and servlets, the first thing to note is that a JSP
page is a
servlet. However, the JSP spec has addressed the needs of resuing servlets
that
already exist in the context of JSP. This means that if you already have
servlets
that work, you can reuse them from a JSP page by including the servlet in
the page
( dynamic file inclusion ).

I hope this helps!
Girish Haran
Member of Technical Staff
Bidder's Edge Inc.

Chris Macias wrote:

> ...and this could probably be expanded to "When to use a servlet and when
> to use a Bean and when to use an EJB", but now we're asking for a white
> paper! :-)
>
> But, seriously, can any of the gurus out there help out us newbies with
> some 'rules of thumb' for when to use which technology? Rough guesses and
> half-formed opinions welcome. It's more than we have now!
>
> Christopher
>
> -----Original Message-----
> From:   Carlos H. Lopez [SMTP:[EMAIL PROTECTED]]
> Sent:   Monday, October 25, 1999 8:25 AM
> To:     [EMAIL PROTECTED]
> Subject:        Re: when to use Bean !!!
>
> I want to add to this question, When use a Bean and When to use a
> Servlet?
>
> Thanks, Carlos.
>
> "The successful man make their own opportunities."
>
> "ACI Team (Chennai)" wrote:
> >
> > Hi
> >         Does any one has clear picture of when to use bean in Jsp....
> > Help of any sort appreciated..
> >
> > Aciteam
> >
> >
>
===========================================================================
> > 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
>
>
===========================================================================
> 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
>
>
===========================================================================
> 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

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