Hi Jonathan,

Comments intermixed ;).

Jonathan Hager wrote:

> I am going to start by making a bold statement, then support that statement
> with my observations.  After introducing XML + XSLT into your architecture
> the need for Java Server Pages disappears!

Well, there's no need to JSP in any web architecture. The idea is to use the tools
that make your life easier. One would use JSP to define the UI easier without
producing the whole HTML from a servlet. After introducing XML + XSLT, there's no
"need" to have JSP as you migh as well produce the XML from a servlet. But some
people might find it useful to do it from JSP for the same reasons it was used to
produce HTML. And after all, JSP's are compiled into servlets so it's not such a
thick layer after you've accessed the first time, it's just a cleaner way to define
your XML without having to recompile your servlets everytime you want to change the
XML document.

> The Model 2 architecture follows the MVC pattern.  The MVC pattern makes a
> lot of sense for dividing the responsibilities of User Interfaces, include
> web user interfaces.
>
> Model 3 (2++) attempts to remove the complexity of looping and
> conditional-branching within the "view".

If it tried to do so, it would fail miserably, IMHO. As soon as you have to produce
a dynamic UI, you will have to have some looping and branching in the view (or in
the way you produce the view), otherwise you have a static document. Model 3 has
indeed, looping and branching in the "view" (XSL), it just uses a wider standard
that fully allows "complete" separation of Java code from UI construction. I put
complete within quotes because of the valid concerns from David Wall regarding the
data formatting, but we already discussed that :).

> In your "model 3" (2++)
> architecture you add two additional technologies to accomplish this - XML
> (Model) and XSLT (View).

Right. I must also note that I'm not talking about always "adding" this layer over
JSP. In our first application we are substituting the JSP layer and using PL/SQL
generated XML. I just thought that without having PL/SQL, JSP's might be a good way
of expressing your model (XML) from Java.

> For argument sake let's say that XML adds another layer to the model.  I
> want to maintain the separation of logic, presentation and data. We use JSP
> to create XML from the JavaBean in Model 2.  --> The JSP becomes a
> conversion specification.  It doesn't makes sense to utilize JSP as a
> conversion specification... one would quickly discover that all that was
> happening was converting properties to an attributes and objects to
> elements.  This would easily be automated.

Of course. If there were a standard Java classes<->XML mapping one might just skip
the JSP and produce the XML from the resulting Beans. However, changes in the XML
model would mean reconstructing your Java Beans so I'm not sure whether we should
link so strongly the XML and Java classes and that's why I was thinking about using
JSP for getting the XML<-> Java independence.


> I could also remove the JavaBean layer all together and replace it with a
> XML to represent my data.  After I can retrieve my Model in XML, my JSP
> completely loses its use.   I just return the XML + XSLT to Cocoon and it
> returns the HTML page.

Agreed. But if you go deep enough using XML, you will start losing the benefits of
using Java, Beans, ... We might as well store our objects as XML in a single table
as a Blob, but I'd rather use SQL and a relational database so querys, updates and
such operations are esier to perform.

> This table summarizes the shift:
>                         Model 2                 -->             Model 3
> (2++)
> Model                   JavaBeans               -->             XML
> View                    JSP                     -->             XSLT
> Controller              Servlet         -->             Servlet
>
> In regards to Model ++2... It is just Model 2 where the JSPs are not created
> by developers or designers but by machine.  This is detailed by Daniel in a
> previous message.

> At this point, I am not convinced that we have a new architecture,
> especially a JSP architecture.  Let me know your thoughts.

I don't think we have a new JSP architecture at all. And that confusion might be my
fault because of the "Model 3" name. But I think it might be something new (Model
or architecture) that allows us to completely separate the model and the view. This
doesn't happen with JSP as you end up with some Java in the view; Taglibs might
help but then my question is "could we get away with a broader standard like XSL,
instead of teaching them JSP taglibs?"

Just my 2c,
Thanks for your input,
Dan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to