Quoting David Geary ([EMAIL PROTECTED]):
> In theory, full separation between model, view, and controller seems preferable
> to an architecture that merges views and controllers. However, in practice a
> clean separation between views and controllers is unworkable because views and
> controllers are typically tightly coupled. For example, it's difficult to
> develop generic controllers that are not to some degree intimately familiar with
> some type of view.
>
> So, if historical precedence is significant, it would seem that JSP's design is
> preferable over that provided by a template system.
Yes, you need some coupling. In WebMacro the view and controller are
coupled, but are still clearly separated objects:
-- the controller chooses the view (you load the template in your
servlet)
-- the view has properties which the controller can examine to
determine what information might be needed (parameters defined
in template that can be tested by the servlet)
-- the controller supplies the data the view will require, directly
to the view (controller populates a hashtable with values and
passes it to the template)
-- the controller can choose not to use the view at all, and
do something else (you don't have to load a template, for example,
you might want to issue a redirect instead of generating HTML).
It's worth mentioning that, though I'm familiar with the MVC paradigm,
I wasn't thinking of it when WebMacro was initially designed. It was
someone else on the list who noted that WebMacro followed an MVC
design pattern--at which point I realized that it actually did, and
tightened up on that design at several points.
The benefit of the separation can be simply expressed, without resort
to any theory: HTML clutters code, and code clutters HTML. Java is a
good and pure language, which is most effective when it isn't diluted.
Similarly, the structure of an HTML document is quickly lost if it's
got too much program code embedded in it.
Naturally there is some matter of taste here. You might not like MVC, or
you might not like it for a website.
However I don't think it is realistic to call JSP an MVC design, despite
claims to the contrary in its documentation. At best it is only a
separation of model from view+controller (as you point out), and that
separation is not owing to JSP, but rather to the excellent Java beans
spec. (you could get that separation from any servlet using EJB).
Justin
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html