Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Push style templating systems

by pKai (Priest)
on Mar 22, 2008 at 13:55 UTC ( #675630=note: print w/ replies, xml ) Need Help??


in reply to Push style templating systems

Parr goes beyond push/pull in his article. The article is titled "Enforcing Strict Model-View Separation in Template Engines".

In his paper he shows that some additions made to "push" are harmless with regard to enforcing model-view separation, i. e. looping and conditionals ("if", but only when you confine to pure boolean testing, no expression evaluation).

He even mentioned HTML::Template as being clean in this respect.

So, while HTML::Template implements looping via its LOOP mini-language control, StringTemplate uses template-recursion for that. Both have, of course, the restricted if, mentioned above. But you list only StringTemplate but not HTML::Template. Why?

Update (2008-03-23 19:25+0000):

Or put the question the other way round (assuming that Rhandom is right, that the point of your list, at least with the Perl part is "no mini-language"): Why do you endorse/mention/include StringTemplate, though it has a mini-language?


Comment on Re: Push style templating systems
Select or Download Code
Re^2: Push style templating systems
by metaperl (Curate) on Mar 24, 2008 at 18:37 UTC
    you list only StringTemplate but not HTML::Template. Why?
    I guess because HTML::Template::Expr raises the entanglement index. But pure HTML::Template is definitely push-style. Added.
    Or put the question the other way round (assuming that Rhandom is right, that the point of your list, at least with the Perl part is "no mini-language")
    When I opened this mode, I stated my purpose. It was to record push-style systems. I don't know why you would figure that Rhandom would know more about my purposes than the ones I stated.
    Why do you endorse/mention/include StringTemplate, though it has a mini-language?
    Because it meets the criteria for strict separation... I'm starting to see that push-style is not what he used as a term. He did use pull-style when referring to tt/mason-esque systems, but he never used to the term pull style to refer to systems like XMLC, etc.
      Actually he does use the term "push strategy" in Definition 8 in Section 7.1

      Thanks for clearing that up, at least somewhat ;-)

      Citing Terence Parr
      The trick is to provide sufficient power in a template engine without providing constructs that allow separation violation.

      It is my understanding that he shows that "push" (his Definition 8) is sufficiently strict to ensure separation. But for the template engine user's convenience you can add things while separation is still enforced.

      He designed StringTemplate accordingly, but StringTemplate isn't pure-push then, isn't it?

        He designed StringTemplate accordingly, but StringTemplate isn't pure-push then, isn't it?
        I don't know what pure push is. If I had to guess, I would say that the 5 rules implied by strict separation, listed after Definition 7, define pure push. And as far as I can see, StringTemplate doesnt break any of those rules.

        I know Seamstress doesnt.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://675630]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-09-20 19:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls