I think this analysis misses the main point. Templates don't save time
by eliminating the need to type println(), the advantages are more
fundamental than that:
-- Encapsulation of presentation issues allows for cleaner
(and therefore more rapid) development, debugging, and
maintenance; as well as more effective page design. In other
words it's easier to see what the servlet is doing when it is a
few short lines of code--and therefore easier to work on.
-- Separation of concerns allows team development. Work on
the template and on the servlet can happen concurrently
-- Separation of concerns allows specialized work; programmers
can build ugly prototypes with the necessary information; page
designers can then make it pretty. Even when these people
are the same person, I think the "right brain" vs. "left brain"
mental shift makes this a big win--concentrate on programming
in the servlet work; concentrate on presentation during the
template work.
-- Templates allow you to plug-and-play the look of a servlet,
even at runtime. Return different presentations depending on the
users preference.
-- Templates can include the use of an HTML editor to make the
creation of the HTML less tedious and more sophisticated.
-- Page design requires working with the whole page; almost
impossible to do with hardcoded statements; natural with
a template based approach.
-- The ability to make quick, easy changes promotes a better
development process. If changes are difficult to make, you
won't make them. You will tend not to revise your approach
when new information about the problem is uncovered. Your
program will become brittle and incomprehensible with each
successive hack. When change is easy, you will embrace it,
adapting your approach to new situations, keeping your code
resiliant and flexible.
In short, a system like WebMacro brings a Model/View/Controller
approach to servlet development, with all the attendent benefits.
http://webmacro.org
It is certainly not just saving the work of typing "println", though
it does that as well. Viewing it as a println problem indicates a
lack of awareness of the whole project, including the need to embrace
change, and the need to partition work.
WebMacro takes this attitude further than other template systems in
that it insists the servlet code must be natural and simple, just
as much as the template. Therefore it bends over backward to avoid
imposing abnormal restrictions on programmers--there are no funny
interfaces that your classes have to implement, instead WebvMacro
performs analysis on your objects to build ways of accessing
their properties (bean-stle, but more aggressive than the basic
bean spec).
WebMacro also emphasizes efficiency, therefore it compiles the template
into an efficient form for fast execution.
http://webmacro.org
Justin
Quoting Danny Ayers ([EMAIL PROTECTED]):
> Hi,
> I'm sure most programmers would agree that hardcoding and templates each
> have their place. One thing that does irritate me though is how systems
> for templates (not just for Java/HTML) keep appearing that require the
> user to learn proprietary techniques, usually scripting languages. All
> are offered as timesavers, 'no hardcoding required' being the selling
> point. Well, I wouldn't have to do any Java hardcoding if I'd bothered
> to learn Perl & PHP scripting...
>
> Cheers,
> Danny.
>
> ___________________________________________________________________________
> 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
___________________________________________________________________________
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