You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Geir Magnusson Jr." <ge...@optonline.net> on 2003/11/13 23:01:47 UTC
Re: a new paper on enforcing separation in template engines
On Thursday, November 13, 2003, at 02:26 PM, Terence Parr wrote:
> Hi there Velocity folks.
>
> I just finished my thoughts regarding strict separation of model and
> view; thought some of you might find this paper interesting. I
> submitted it to the WWW 2004 conference entitled, "Enforcing
> Model-View Separation in Template Engines":
>
> http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf
>
> You'll note that I am a ruthless dictator when it comes to separation.
> For example, no logic at all in the template meaning most of the IF
> constructs in Velocity are in violation according to my separation
> rules.
I agree with you. I also agree with the assertion that 'pull' is a
violation of MVC.
>
> The paper makes both theoretical (sorry for all the language theory
> mumbo jumbo) and empirical arguments that you don't need to entangle
> (by my definition) to get power. My StringTemplate engine, used to do
> jGuru.com etc..., has no FOR loops or anything like that and yet can
> generate whatever you want. I enforce rather than encourage
> separation. Just about everybody says that, but I think you'll find
> by my rigid definition of separation, nobody really enforces it.
> Well, StringTemplate, HTML::Template, and XMLC get entanglement
> indexes of 1 whereas Velocity allows breaking of all five rules
> getting an index of 5. ;)
And we're damn proud if it. Time for a press release :
"Velocity rated '5' on scale of 1..5 for Template Engines"
:D
>
> Not trying to cause an uproar or flamewar...just trying to open up a
> conversation. :)
I did a quick scan, and I like what I read. I'll give it a careful
read. Can I mention it on the velocity home page? It doesn't have
anything to do with us, and I know 5 is bad, but people might be
interested.
geir
>
> Best regards,
> Terence
>
> ABSTRACT
> The mantra of every experienced web application developer is the same:
> "thou shalt separate business logic from display." Ironically, almost
> all template engines allow violation of this separation principle,
> which is the very impetus for HTML template engine development. This
> situation is due mostly to a lack of formal definition of separation
> and fear that enforcing separation emasculates a template's power. I
> show that not only is strict separation a worthy design principle, but
> that you can enforce separation while providing a potent template
> engine. I demonstrate my StringTemplate engine, used to build
> jGuru.com and other commercial sites, at work solving some nontrivial
> generational tasks.
>
> My goal is to formalize the study of template engines, thus, providing
> a common nomenclature, a means of classifying template generational
> power, and a way to leverage interesting results from formal language
> theory. I classify three types of restricted templates analogous to
> Chomsky's type 1..3 grammar classes and formally define separation
> including the rules that embody separation.
>
> Because this paper provides a clear definition of model-view
> separation, template engine designers may no longer blindly claim
> enforcement of separation. Moreover, given theoretical arguments and
> empirical evidence, programmers no longer have an excuse to entangle
> model-view.
>
>
> --
> Professor Comp. Sci., University of San Francisco
> Creator, ANTLR Parser Generator, http://www.antlr.org
> Co-founder, http://www.jguru.com
> Co-founder, http://www.knowspam.net enjoy email again!
> Co-founder, http://www.peerscope.com pure link sharing
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
--
Geir Magnusson Jr 203-247-1713(m)
geirm@optonline.net
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: a new paper on enforcing separation in template engines
Posted by Jonathan Revusky <re...@wanadoo.es>.
Geir Magnusson Jr. wrote:
>
> On Thursday, November 13, 2003, at 02:26 PM, Terence Parr wrote:
>
>> Hi there Velocity folks.
>>
>> I just finished my thoughts regarding strict separation of model and
>> view; thought some of you might find this paper interesting. I
>> submitted it to the WWW 2004 conference entitled, "Enforcing
>> Model-View Separation in Template Engines":
>>
>> http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf
>>
>> You'll note that I am a ruthless dictator when it comes to separation.
>> For example, no logic at all in the template meaning most of the IF
>> constructs in Velocity are in violation according to my separation rules.
>
>
> I agree with you. I also agree with the assertion that 'pull' is a
> violation of MVC.
>
>>
>> The paper makes both theoretical (sorry for all the language theory
>> mumbo jumbo) and empirical arguments that you don't need to entangle
>> (by my definition) to get power. My StringTemplate engine, used to do
>> jGuru.com etc..., has no FOR loops or anything like that and yet can
>> generate whatever you want. I enforce rather than encourage
>> separation. Just about everybody says that, but I think you'll find
>> by my rigid definition of separation, nobody really enforces it.
>> Well, StringTemplate, HTML::Template, and XMLC get entanglement
>> indexes of 1 whereas Velocity allows breaking of all five rules
>> getting an index of 5. ;)
>
>
> And we're damn proud if it. Time for a press release :
>
> "Velocity rated '5' on scale of 1..5 for Template Engines"
>
> :D
>
>>
>> Not trying to cause an uproar or flamewar...just trying to open up a
>> conversation. :)
>
>
> I did a quick scan, and I like what I read.
You did??? Really??? I clicked on the link to read it and got a 403
Access forbidden error.
<shrug>
Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
FM-Vel comparison page: http://freemarker.org/fmVsVel.html
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
RE: a new paper on enforcing separation in template engines
Posted by Tim Colson <tc...@cisco.com>.
Terence wrote:
> "thou shalt separate business logic from display."
> Ironically, almost all template engines allow violation
> of this separation principle,
Heh heh. You should have been around last summer to read the reparte
when I asked if [theoretically speaking only] would it be possible to
change the grammar so #if ($foo) would ONLY allow boolean values, i.e.
no evaluated expressions just TRUE or FALSE like HTML::Template. Whoo
boy, that was fun. ;-)
I had a glimpse of the paper, and what I skimmed was indeed interesting,
but like others, I'm now getting a 403 error.
I just want to know what entanglement index JSP receives?
Surely there must be more to the scale than 1..5 ?
"If Velocity is a 5, then JSP... goes to 11."
-Timo
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org