Hi,
Some people asked my about this "Model 3" I talked about in my last
posting about "model 2 servlet mapping question" so I thought I should
explain what I meant, not to confuse people. First, before people starts
asking about specifications and documentation, it's by no means an
official name and AFAIK it hasn't been mentioned anywhere. It's just an
idea several people in this list seem to be using and I just have to
give it a short name so... my apologies if this drrove someone to
confusion. Explanation follows:
After playing a while with model 2, I have to admit it's far for perfect
and one of the places where it doesn't convince me is in the part where
web designers (non programmers) have to deal with JSP code to generate
the UI. Sure that taglibs will help and sure that tools will come up to
help drag&drop development but it still doesn't convince me so I
thought, as many others, of using XML&XSL as an extra layer(hence the
name Model 3) between the generation of the data and the construction of
the UI. The architecture goes like that:
.- Controller servlet gets a request and determines the appropriate
Action to be executed.
.- The Action performs the business logic using the data sources (Files,
DB) and forwards control to the appropriate JSP to "format" the result.
.- The JSP page formats the result in XML, which is more easily
understood by designers, can be used as documentation, and for which
fake document sets are easily generated. The JSP can also determine "on
the fly" which XSLT sheet will be used to generate the UI.
.- The XSLT sheet transforms the XML into HTML, WML, PDF and result is
sent to the client.
Advantages:
.- Programming part and design are completely separated. You just agree,
at the beginning if possible, the format of the XML documents and then
the programmer have to care on how to generate them dynamically and the
designers on how to generate the UI from them.
.- IMHO, there will be more tools to handle XML&XSL -> HTML than
drag&drop JSP to HTML. XML, XSL are already standards, taglibs are not,
and it will be easier to train, or find somebody trained, in these
technologies than in using taglibs with some mixed Java.
.- Your desing is more technology independent, you might decide to
change to WebMacro to generate the XML and you wouldn't have to bother
your designers with a new syntax. For example, in our first application
we are going to mix XML generated from JSPs with XML generated directly
with PL/SQL.
.- There are some others because of using XML, XSL but I'm focusing on
the XML&XSL vs JSP.
Disadvantages
.- Performance: We have yet to test it but adding an extra layer always
means more computations. We are trying to avoid that using direct
generation of XML from PL/SQL when possible but we know we'll have to
pay for this extra layer. We hope improvements in the parsers and smart
caching of XSLTProcessors will help in this regard.
.- XSL,XSL are not widely known by designers. But we hope that's a
matter of time before tools and relatively widespread knowledge of the
technology are there. And you would have to teach your designers your
taglib&Java-mix syntax anyway so...
We are developing our first application using these approach and that's
what we've learnt so far. I know it can be an overkill for some apps.
but it might be very adequate for others. Anybody that's using it has
gathered more info? Comments anyone? Anybody can think of another, more
appropirate name? ;)
Regards,
Dan
-------------------------------------------
Daniel Lopez Janariz ([EMAIL PROTECTED])
Web Services
Computer Center
Balearic Islands University
-------------------------------------------
===========================================================================
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