Like others I'm sure, I too found Craig's discourse to be very good.  One
thing I'd add is that I actually find model 2 to be easier than model 1.
Perhaps I'm weird in that way, but it's what I've been doing ever since I
started working with JSP, so...

A few more thoughts.

I'm an application developer, who's primary development language is Java,
but I am not just a Java developer.  What this means is I am involved in all
aspects of application development.  I benefit from being able to develop
the interface as well as the the guts of the application.  That used to mean
Java AWT, until clients started preferring HTML based interfaces.  I
consider myself proficient in HTML based interfaces and feel that is a
requirement for my job.  Therefore separation of HTML and Java is to me more
to do with developing clean, easily maintainable code.  I never liked
generating HTML in servlets and JSP allows me to separate the code from the
servlet.

I also believe that it is important to be able to design and, more
importantly, redesign a web page, be it HTML or JSP.  Although I don't use
WYSIWYG tools for HTML myself, I recognize other people do, and see the
importance of the page being viewable in these.  In this light I actually
see a downside if too much HTML code is generated through beans, and a
benefit to using scriplets.  I disagree with the puritan view that
scriptlets should never be used, and hope I can bump into some of you that
think differently at JavaOne so I can have you show me how I could approach
the problems I use scriptlets for differently (Let me know if you are going
so we can meet up and chat about JSP - in fact I think that would be a very
beneficial thing: an informal JSP round table).

I have developed a few beans that do things like generate pull down lists
and such, but my use of beans is primarily to hold data, and I've
genericized that so that I use the same data bean for all my data needs.  I
suppliment things by using other Java utility beans to do various formatting
or conversions.

Since my web applications are exactly that, business applications with web
interfaces, the model 2 approach is a natural.

- The page submits a call to a servlet, generally sending <FORM> parameters
with the request.
- The servlet is responsible for database connections, queries, inserts,
updates and deletes.  And determines what page (HTML or JSP) to display next
based on the request and the results.  The web apps I'm building all have a
login requirement, so I manage that on the servlet side as well.
- If the page is a JSP then it will likely be passed various beans,
typically including a data bean and perhaps other simple String or Vector
beans which contain other flags or information the JSP page will need to
generate the dynamic parts of the page.  I exclusively use <% %> and <%= %>
to populate the page with data or generate the HTML, in tandem with the
utility beans I mentioned above.  My pages are different enough in their
needs from one another that finding fodder for reuseable beans (and I'm
always looking for opportunities) is limited.
- The page displays and the process begins again as appropriate (either via
a user's command or because another servlet call is made to produce a page
in another frame).

Maybe some of you are solving the same types of solutions and can relate to
what I'm saying.  I do think some of you are trying to bang a square block
through a round hole with some of the requests or statements you are making.
Perhaps some of you are neglecting to recognize that there are quite a few
different needs out there and the solutions to them are not all the same.

Anyway, thanks for reading my take.

Dan
--
Daniel Kirkdorffer
Sr. Consultant, Syllogistics LLC
Web:   http://www.syllogistics.com/
Email: [EMAIL PROTECTED]


> ----------
> From:         h wulfson[SMTP:[EMAIL PROTECTED]]
> Reply To:     h wulfson
> Sent:         Wednesday, April 21, 1999 10:08 AM
> To:   [EMAIL PROTECTED]
> Subject:      Re: Why Model 2?
>
> I agree. The real advantage of Model 2 is that it
> enables a more complex flow of control.
>
> Unfortunately Craig's statement (which I found
> immensly useful) is a little misleading. Scriptlets
> are bad in Model 1 also, and there is nothing in Model
> 1 that encourages their use. That is to say that
> seperation of content and business logic is not a
> model 1 vs. model 2 issue. It is simply a matter of
> good design.
>
> After experimenting a little with JSP, I think it is
> possible to use Model 1 with good results by using
> only one bean per JSP page. This bean makes references
> to other more general data entity beans.
>
> Unfortunately Model 1 lacks a good method of directing
> the application flow. If it did then the importance of
> Model 2 would be diminished. My wish would be for the
> processRequest method to be able to forward to another
> page. There would be no conflict if you only use one
> bean per page.
>
> -Harris
>
>
>
>
> --- Becton Dennis <[EMAIL PROTECTED]>
> wrote:
> > Craig,
> >
> > Very nicely written document.  You are obviously a
> > 'word-smith'.   I'm not
> > saying that's a bad thing!
> >
> > My take on the Access Model Wars, as a
> > 'code-pounder':
> >    Use the servlet to JSP model when flow of control
> > issues require it.
> >    Otherwise, use the JSP access model in
> > conjunction with Javabeans (no
> >    Java code in the JSP page), which still maintains
> > development role
> >    separation.
> >
> > Bottomline, Keep it simple wherever possible.
> >
> > - Dennis
> >
> >
> >
> >
> >
> > "Craig R. McClanahan" <[EMAIL PROTECTED]> on
> > 04/21/99 12:52:05 AM
> > Please respond to Craig McClanahan
> > <[EMAIL PROTECTED]>
> >
> > To:   [EMAIL PROTECTED]
> > cc:    (bcc: Dennis S. Becton/VGI)
> > Subject:  Re: Why Model 2?
> >
> >
> >
> >
> > Wine Vaughn wrote:
> >
> > > I've been monitoring this list server for several
> > weeks now, and several
> > > people have commented that they like using Model
> > 2.  (There are two JSP
> > > approaches mentioned in JSP spec 0.92.  They are
> > refereed to as Model 1
> > and
> > > Model 2.)
> > >
> > > Why?  What advantages does Model 2 have over Model
> > 1?
> > >
> > > I've used Model 1 in several scenarios, and I
> > cannot see what advantage
> > > Model 2 would provide.  The only thing that comes
> > to mind is Model 2
> > > separates the logic a little bit more.  However, I
> > prefer to have the
> > bean
> > > do the processing with processRequest, instead of
> > dividing the work
> > between
> > > a servlet and bean....
> > >
> > > Comments?
> > >
> > > Vaughn Wine
> >
> >     --- BACKGROUND ---
> >
> > Being one of those who has advocated the "Model 2"
> > approach, it is probably
> > appropriate for me to take a crack at this one.  But
> > first, you need a
> > little
> > background information about the kinds of problems I
> > am facing.
> >
> > I am currently in design phase for a large scale
> > application, to be
> > deployed
> > on the public Internet, that will be based on Java
> > and JSP technologies.
> > In
> > particular, I've got several needs driving the
> > design:
> > * Total page count on the site will be upwards of
> > 1000 pages
> >   (over time -- initial site will have ~100 pages).
> > * Integration of content and applications from
> > multiple content
> >   providers and developers.
> > * Approximately 80% of the pages will be dynamically
> > generated,
> >   the remainder pretty much static HTML.
> > * Majority of the site will be more akin to
> > traditional client/server
> >   applications systems in its business logic
> > complexity, rather than
> >   the typical web site that has very little
> > processing logic.
> > * Must be deployed in multiple languages (initially
> > English, French,
> >   Spanish, Dutch, and German).
> >
> > I am not "anti" Model 1 for applications of a
> > certain scope, except for one
> > particular feature (described futher below).
> > However, there are a bunch of
> > reasons that I am planning on exploiting a Model 2
> > architecture for this
> > application that are worth discussion.
> >
> > Many people have asked for tutorials and white
> > papers on JSP, and in
> > particular on web application design concepts.  The
> > best one I have found
> > so
> > far is by IBM, entitled "The Web Application
> > Programming Model".  I highly
> > recommend that serious students of web application
> > design download and
> > study
> > this paper, which can be found at:
> >
> >     http://www.software.ibm.com/ebusiness/pm.html
> >
> > (No, I don't work for IBM.  It is not necessarily
> > likely that I will even
> > use
> > IBM's products to build this site.  But this is a
> > pretty good overview of
> > the
> > technological underpinnings of web based
> > applications.)
> >
> > The remainder of this discussion is divided
> > (somewhat arbitrarily) between
> > more high level strategic concerns (entitled
> > "philosophical issues") and
> > lower
> > level tactical concerns (entitled "practical
> > issues").  I am not going to
> > discuss at all why JSP is a good idea in the first
> > place -- it is :-) --
> > the
> > focus is on the differences between Model 1 and
> > Model 2 JSP-based designs.
> >
> >     --- PHILOSOPHICAL ISSUES ---
> >
> > SEPARATION OF PRESENTATION DEVELOPMENT AND BUSINESS
> > LOGIC DEVELOPMENT.  In
> > many large scale web application environments, the
> > look-and-feel part of
> > the
> > design is done by experts in HTML (who may have some
> > light programming
> > experience, particularly with JavaScript), while the
> > heavy duty business
> > logic
> > programming is done by experts in Java and databases
> > (who may have some
> > light
> > HTML experience, having probably developed simple
> > servlet based
> > applications,
> > or equivalents with ASP or other technologies, in
> > the past).  It is much
> > easier to focus developers who are expert in one
> > technology or the other in
> > a
> > "Model 2" approach, whereas this is not as easy in a
> > Model 1 approach.  In
> > the
> > latter case, it is much more likely that you see
> > logic and presentation
> > mixed
> > (especially due to scriptlets), meaning that you
> > need someone who is expert
> > in
> > both technologies to maintain them.  How many
> > developers out there (given
> > the
> > current market demands) can you find that are good
> > at both of these?
> >
> > MODEL-VIEW-CONTROLLER ARCHITECTURE.  The history of
> > complex application
> > systems design has proven that the fundamental MVC
> > paradigm, even though it
> > might be more complex in the early stages, leads to
> > better designs from the
> > long term business viewpoint (ROI, lower
> > cost-of-ownership, and so on).
> > The
> > "Model 2" approach lends itself directly to this
> > architecture (JSP and
> > formatting beans = view, servlets = controller,
> > command beans  and business
> > logic = model).  This strict separation of roles is
> > blurred in a "Model 1"
> > environment.
> >
> === message truncated ===
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff JSP-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to