The company where I work do not want too many technologies to be used -
making the system unnecessarily complex. I had ventured to use JSP but it
fizzled out : I had problems in compiling and deploying them successfully.
It would have been a good step ahead from writing ugly html-presentation
code in the servlets. On the other hand, if we are too careful with the html
coding in the servlets, we really do not require JSP though it would
definitely make life so so much more modular. There might be other
advantages of JSP which I don't know but I am speaking from a lack of
experience here.
    After reading about your mini-application server set-up, I would hv to
say that u hv managed to put together some real nice concepts though many of
which are not necessary for small systems - like the one I am currently
working on. I have some servlets doing the validation/queryng-updating the
database and one servlet which uses a bean which reads a set of questions
from a text file, creates a form and returns it to the client. These
questions are going to be dynamically generated now i.e the user can
add/remove qns which takes me to seriously consider XML. Using Oracle's XML
parser, I am planning to create a well-formed and valid XML with the
nexessary dynamic data from the database. This XML would hv a xsl to filter
out the necessary data depending upon the user selection and display only
the quesitons which that user had preferred. The xsl would also hv the
necessary css logic to render it in html. To chnge the qns, there would be a
Java aplication(using Oracles class generator) which would manipulate the
DOM.
    In essence we have few technologies : servlets, client-side
java/javascipt,
XML and the back-end database, not to forget the beans. This is more or less
sufficiient (for now(?)) . There are numerous optimizations which can be
done
on the existing system (some of whch u hv mentioned in this mail)
without introducing more technologies!!

Raaj.

----- Original Message -----
From: Daniel Lopez <[EMAIL PROTECTED]>
To: Rajendra Mishra <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, October 29, 1999 7:26 AM
Subject: Re: FW: when to use Bean !!!


> Hi Rajendra,
>
> Rajendra Mishra wrote:
> >
> > Dan,
> >
> >     I hv a few servlets which basically form a part of of one module.
> > Similarly there are some more modules having more servlets. Ur concept
of
> > having a servlet control manager sounds very promising. It definitely
would
> > lessen repeated code but will it really help in the long run to make the
> > system maintanable/extensible and simple?
>
> In my case, I have a single servlet (WAFManager) that reads
> configuration of applications(what you call modules) from a XML file and
> handles all requests. The operations that encapsulate business logic
> just have to fill three methods (setParameters, checkParameters,
> performOperation) so they are very simple and easy to maintain, as they
> are simple and presentation-independent they can be also easily reused.
> The application lifecycle events and security(I'm thinking about adding
> basic logging here) are handled centrally, they can be as independent as
> you want from the business logic inside the operations and they can be
> customized very easily through interfaces/abstract classes. They are
> also configured through XML so no compile-time dependencies are
> included. Right now I created a user interface to view the configuration
> of the WAFManager but I'm planning on extending it to allow me to modify
> the options in runtime(right now I just have to reload the XML file
> but...) and to provide some interfaces to the standard services like
> application management(enable/disable...), security(who is inside?,
> reload cache...).
>
> I know it sounds like I'm creating my own Apps server myself but I'm
> trying not to, my goal is to create a lightweight framework for
> servlet/JSP applications that can be extended easily and that allows me
> not to write the same code again and again (logging and security being
> the hot topics here). Then, if you want to use an App server for parts
> of your application, that's your choice. Actually, We are using Jonas
> EJBserver for the proof-of-concept application that we are developing
> now.
>
> So I hope it will really help in the long run because that's the main
> goal of building it. I agree with you that one of the dangers is to let
> it grow it too complex. Then it would be another fatware app server but
> one that we have to mantain ourselves. Note that Orion server provides
> some/most of the functionality that I'm implementing but I couldn't find
> much information about pricing and licenses of this server and because I
> wanted more simplicity in some areas and more flexibility in others
> so...
>
> >     I hv never used url mapping. Cn u suggest me some exps?
>
> Craig McClanahan already talked about it (actually, I got the idea of
> the WAFManager from the technique he described, thanks Craig :) but I'll
> summarise it:
> .- Configure your servlet engine to redirect all the URL's that mapp to
> some specified criteria to your "Dispatcher Servlet". For example
> *.suffix or /keyname/*
> .- In the "Dispatcher Servlet" get the path that was used to call the
> servlet(request.getServletPath()) and parse it to identify which
> operation is he calling, in my case you also get the application. You
> might use here a Hashtable or any other mapping technique.
> .- With that data, get the name of the servlet/JSP that you want to call
> depending on the operation. Here I use a different technique as I
> actually perform the operation itself, because they are not servlets.
> .- Use RequestDispatcher.forward to call the appropiate servlet/JSP
> page. If you forward to a servlet you might also want to forward to a
> JSP page from inside the servlet, to separate business logic from UI.
>
> Ex
> .- In your servlet engine configuration, map "*.accounting" to
> DispatcherServlet
>
> .- http://myhost.com/showCustomer.accounting is called, the
> DispatcherServlet decides that he wants to call the operation
> "showCustomer" from the application "accounting".
> .- DispatcherServlet finds out that for "showCustomer" he has to forward
> control to the servlet "showCustSevlet"
> .- DispatcherServlet performs a forward to servlet showCustSevlet, in
> that servlet you perform the business logic and then you might decide
> there that the UI for the operation is showCust.jsp and then forward
> control to it.
>
> It can get more complex than that, but that's the basic technique
>
> >     Also, the idea of writing a bean to do the business logic is good
but
> > again, there will be one (or more) bean for every servlet. this makes
the
> > system bigger. But I think the ease of changin the business logic
without
> > touching the servlet-html stuff is definitely a time saver. I am
currently
> > not using JSP.
>
> I was not using it until I discovered it :). I implement the business
> logic in EJB beans so if your system gets bigger, get a bigger/better
> EJB server, and I just use the JSP to show the results which usually are
> small beans (usually a couple of single beans or collection of beans) so
> the JSP pages are not overloaded.
> So I have four levels:
> .- The information model (The database)
> .- The business logic (EJB)
> .- The "operational logic" (Get parameters from input, perform the
> operation, format output. Depending on the application) (I use my own
> class ServletOperation here, but other people use full Servlets)
> .- The user interface (JSP)
>
> So far, I have to say that I'm very happy as how the framework looks and
> how it seems it will evolve but for one big "but". And that is that I
> don't like creating/mantaining my own frameworks in this ever/changing
> world of internet app development. I'm getting as close to standards as
> I can and I try to provide just the funcionality that standards don't
> provide and use the rest but... you never know. At least, I'm learning
> what I'll ask to an app server next time I have to use one for this
> purpouse.
>
> I hope this helps,
> Dan
> PD: If you could please forward the message to the JSP list I'd really
> appreciate it as we still have problems with our mail configuration.
> -------------------------------------------
> Daniel Lopez Janariz ([EMAIL PROTECTED])
> Web Services
> Computer Center
> Balearic Islands University
> -------------------------------------------
>
> >
> > Raaj.
> >
> >     > 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

Reply via email to