Daniel Florey wrote:

OK, the example you've picked out seems to be complicated (as I've state in the documentation). My intention for this templating was: 1. To make it very simple. You just mark the dynamic parts in html pages and you optionally specify the matching content type. 2. It is not targeted towards java programmers, but should be handy for people with html knowledge. They can simple take their static html-pages and turn them into projector templates without java skill. 3. I've choosed the <%variable%> syntax as many html-editors (like adobe go live) handle this correctly as it is close to ASP syntax. 4. See documentation why I've added the <? ... ?> expression.

But I'm very open to suggestions how to make it even simpler. As the tag
identifiers are defined in a static String, it is very easy to replace them
with other tags.

- I don't think that the example you gave is extremely complicated but pretty simple.


- I'm not trusting the role separation up to this point. This is a nice marketing speech, but reality seems to be far different to me. Velocity 'or another template) is said to be targeted toward people with html knowledge when using it as a view in a mvc, but there's no way that someone with no programming knowledge will be able to go through more than 2 screens without duplicating massive logic between pages.

A dynamic page requires presentation logic, and there is no way that you can write such logic without programming knowledge (note: that does not mean the business logic is in the page). And presentation logic can (and need) to be factorized as well. Someone with no programming knowledge/concept can hardly do this.

I'll avoid jsp's as it enabled people to fill programming code into the
templates and decreases reusability. I've worked in so many project where
all of the logic was coded into jsp that I still feel it's clever to
prohibit programming code in the templates.
Start using it and I hope you'll share this feeling ;-)

That's an understandable feeling. I know the pain. I'm part time on a project where every EJB lookup is right into the JSPs, and I know what a headache this is. One change in the model goes all the way till the pages where you have the business logic.


However.

I don't think we should forbid the use of fork and knife because it can be badly used by kids.

Having been doing projects with full xml/xslt and Velocity, I also know the pain of these solutions when applying it to a large number of screens. There's no silver bullet to me.

Someone even tried to sell me separating the presentation logic of secured data into a ldap directory so that we were close to the "invisible framework"[1] in the view: it was merely a <mytag:display/>, if you have ever tried customizing presentation logic by modifying data in a ldap directory, you should, that makes everything fun in comparison. :)


[1] http://www.depeupleur.com/blog/TT_blog/archives/000020.html

If you feel like using a template language, I will probably recommend to look at StringTemplate (www.stringtemplate.org)
Enforcing Strict Model-View Separation in Template Engines
There's a nice paper from Terence Parr to read:
http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf


Which I agree mostly except in definition 7 rule 3. I think the JSTL syntax ${empty elements} is actually kind of an interesting compromise.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to