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".