tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felipe Schnack <feli...@ritterdosreis.br>
Subject RE: JSP's, scriplets, and logic
Date Mon, 28 Oct 2002 14:16:28 GMT
  Yes, actually I divide my application in various layers. Explaining it
a little better
  - I have classes that are just data containers, not business logic at
all
  - I have classes that are just business logic, and operate in the
first type of classes
  - To glue them all together, I have a servlet that I call FormManager.
This servlet calls subclasses of "Form". Each of these forms are
actually HTTP get/response handlers that validate its parameters and use
them to call the second type of classes I described. This class also
redirects the browser to the success/error page as needed.
  As you can see, the "form" classes are actually just a excuse to not
write dozens of servlets... but this is very organized, IMHO... I like
this process.
  
On Mon, 2002-10-28 at 13:01, Wagoner, Mark wrote:
> This approach has also worked well for me with one variation.  I have one
> servlet which performs any initial validation/database connection
> processing, then forwards the request to one of several dozen "processor"
> objects.  The processor then creates the beans and calls the JSP page for
> output.
> 
> I have found that it is easier to trace a request with one source of entry,
> and by placing my URI-to-processor mappings in a properties file I can add
> functionality by creating a new processor object and adding a line to the
> file.  My web.xml file is very simple as well, since the lone servlet reads
> the startup parameters and initializes any singleton or factory processors
> accordingly.
> 
> -----Original Message-----
> From: Felipe Schnack [mailto:felipes@ritterdosreis.br]
> Sent: Monday, October 28, 2002 8:49 AM
> To: Tomcat Users List
> Subject: Re: JSP's, scriplets, and logic
> 
> 
>   My approach is to have some servlets and lots of beans :-)
>   Roughly speaking, I execute any database query in servlets, fetch data
> into beans use standard taglibs to show data (mainly tags to iterate
> bean collections and to get bean values). I use the request taglib a lot
> too.
> 
> 
> On Mon, 2002-10-28 at 12:41, Matt Fury wrote:
> > Yes, 
> > 
> > Again I agree, it can get sloppy. So what would you
> > reccommend? Many servlets? many beans? Just curious
> > thats all. Lots of times I think there isn't much to
> > separate. I am asking because I strive to become a
> > better programmer as we all do. Advancing to higher
> > levels means understanding business logic. I worked
> > for a company who partnered with Rational so we were
> > all about business logic. 
> > 
> > I don't have a problem taking this offline for a bit
> > if anyone wants to discuss furthur.
> > 
> > Thanks.
> > 
> > -Matt
> > 
> > 
> > 
> > --- wsweetman@mac.com wrote:
> > > No its just good design.  Its thinking of the
> > > future.  Badly 
> > > partitioned code is one of the prime reasons that
> > > leads to 
> > > unmaintainable code
> > > On Friday, October 25, 2002, at 08:43 PM, Matt Fury
> > > wrote:
> > > 
> > > > Yes I agree,
> > > >
> > > > but not all projects warrant EJB's or the like.
> > > > I think lots of times trying to separate business
> > > > logic is just overkill.
> > > >
> > > > -Matt
> > > >
> > > > --- John Trollinger <jakarta@trollingers.com>
> > > wrote:
> > > >>
> > > >>> Which implies you're putting code in scriptlets,
> > > >> right?  Sheesh ...
> > > >>>
> > > >>> Java code to implement business logic belongs in
> > > >> Java
> > > >>> classes, not intermixed with your presentation
> > > >> markup in a JSP page.
> > > >>
> > > >>
> > > >> If only more people would listen to this!!!!!
> > > >>
> > > >>
> > > >> --
> > > >> To unsubscribe, e-mail:
> > > >>
> > > <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > > >> For additional commands, e-mail:
> > > >> <mailto:tomcat-user-help@jakarta.apache.org>
> > > >>
> > > >
> > > >
> > > > =====
> > > > ------------------------
> > > > int myName() {
> > > >   cout << "-Matt Fury \n";
> > > >   return 0;
> > > > }
> > > > ------------------------
> > > >
> > > > __________________________________________________
> > > > Do you Yahoo!?
> > > > Y! Web Hosting - Let the expert host your web site
> > > > http://webhosting.yahoo.com/
> > > >
> > > > --
> > > > To unsubscribe, e-mail:   
> > > >
> > > <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > > > For additional commands, e-mail: 
> > > > <mailto:tomcat-user-help@jakarta.apache.org>
> > > >
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail:  
> > > <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <mailto:tomcat-user-help@jakarta.apache.org>
> > > 
> > 
> > 
> > =====
> > ------------------------
> > int myName() {
> >   cout << "-Matt Fury \n";
> >   return 0;
> > }
> > ------------------------
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Y! Web Hosting - Let the expert host your web site
> > http://webhosting.yahoo.com/
> > 
> > --
> > To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
> > 
> -- 
> 
> Felipe Schnack
> Analista de Sistemas
> felipes@ritterdosreis.br
> Cel.: (51)91287530
> Linux Counter #281893
> 
> Faculdade Ritter dos Reis
> www.ritterdosreis.br
> felipes@ritterdosreis.br
> Fone/Fax.: (51)32303328
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
> 
-- 

Felipe Schnack
Analista de Sistemas
felipes@ritterdosreis.br
Cel.: (51)91287530
Linux Counter #281893

Faculdade Ritter dos Reis
www.ritterdosreis.br
felipes@ritterdosreis.br
Fone/Fax.: (51)32303328


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message