Daniel Lopez is temporarily unable to post to the list, so he asked me to forward the
following. Sorry I took so long, Dan!
-----Original Message-----
From: Daniel Lopez [SMTP:[EMAIL PROTECTED]]
Sent: Monday, October 25, 1999 12:21 PM
To: Macias, Chris
Cc: [EMAIL PROTECTED]
Subject: Re: when to use Bean !!!
Hi,
Let me add my 2c, as Craig "suggested" that's quite a question and it's
better to learn about the technologies and then decide by yourself, but
you asked for some opinions so...
In my case I'm using all of them at the same time.
.- I use a servlet that acts as control manager of the applications and
takes care of security, logging issues and flow control. I use here
something like the technique described by Craig for having just one
servlet and using url mapping to define diferent operations.
.- Applications are defined as a set of instances of a class called
Operation(so they are not sets of servlets) and they have standard
methods that the manager servlet uses to initialize the parameters,
perform the operation and forward the result where appropiate. I thought
about not using servlets because they almost always follow the same
pattern (set the parameters, execute, forward to a JSP to see the
results) and this way I can control all the "operations" as a coherent
set of functionality, instead of a set of scattered servlets.
.- The operations usually perform their functionality through EJB Beans.
I have the bussines logic encapsulated with EJB so the operations are
just the interface to call the EJB Beans appropiately given the
parameters of the request and to handle gracefully some errors
conditions.
.- JSP pages are used as user interface only, to display the results of
the Operations performed. Those Operations communicate the results to
the JSP through standard classes, even though I'm planning to try to
make them beans, so I can save some Java code on the JSP.
.- Just to add some spice to the mix, and as Craig suggested, I use XML
to define the configuration of the application, including operations
defined(loaded dynamically in runtime), security access settings,
application-wide events... I get most of the information from a
database, I use JavaMail for logging purposes... You see that one of
this things can get quite complex. So I'd recommend to start from the
beggining and add ingredients to the mix when you feel more comfortable
with the ones you are using. You can also get an Application Server that
does most of this for you :), I did it myself because I'm not quite
satisfied with the ones I've tested so far so I'm building my own
lightweight environment with so many standard features as I can so I can
replace them with features built in all app servers when they become
real standards.
I know this is not really an answer to your question, but I hope it
helps somehow.
Regards,
Dan
-------------------------------------------
Daniel Lopez Janariz ([EMAIL PROTECTED])
Web Services
Computer Center
Balearic Islands University
-------------------------------------------
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