Kevin, thank you for passing along the model that you are using for
development with JSP's.
> > As I see it, both do pretty much the same thing, but a bit
> > differently. The Model 1 uses a JSP page as its starting point,
> > instantiates a bean object (or more than 1 if the developer so desires),
> > calls a method in the bean (usually passing the request and possibly the
> > response object to the method, maybe named processRequest() ). That
> method
> > uses the request object to populate various private fields via setter
> > methods. With introspection, if a form data is passed, the setter
> methods
> > that match the element names of the form are called to automatically set
> > the properties of the JavaBean. Now..this is one of the areas I am not
> > sure
> > about..but I "think" the Model 2 approach does NOT do this.
[Bomberry Bill] I also did not find a way for the automatic mapping of the
ServletRequest parameters to the JavaBean in model 2. We are planning to
write a superclass that the JavaBeans inherit from that will use reflection
and the JavaBean interface to do the mapping. That is, we will use the
request parameter name, prepend "set" and invoke the setter on the JavaBean
with introspection. We will also convert from String to the Java primitives.
I would prefer to have the container provide this functionality but the
layer of code is thin and I believe the model 2 better suits the needs of
the types of applications that we develop.
The JSP contains formatting and display logic only. This role for JSP is
preferred for the reasons outlined below.
* As Akerley, Koutsoumumbos, Hashim and Maffione suggest, in terms of
the Model View Controller pattern there is a cleaner separation between the
View and controller logic. (1999, p. 6).
* Akerley et al. also point out that this approach limits the Java
code imbedded in the JSP. Hence, it allows us to use the best tools for
HTML/JSP and Java. (1999, p. 6) The benefits of limiting the Java code
include following logic flow using the search methods of the IDE.
* Java developers and HTML developers are less likely to be working on
the same code.
Akerley, J., Koutsoumbos, A., Hashim, M.,Maffione, A. (1999, December) Java
Server Pages and Servlet Design: How to build maintainable systems more
quickly, Java Report, Volume 4, Number 12, pp 24-30.
> > I am using the Model 1 approach because of its more simplistic
> > implementation and maintenance.
[Bomberry Bill] Model 2 provides a layered approach which adds complexity
in some regards but in the long run should reduce maintenance time. One
reason for a reduction of maintenance time is that layering provides a meta
view of the application. Also changes may be localized to a particular
layer.
regards,
Bill Bomberry
>
===========================================================================
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