In his paper
"Enforcing Strict Model-View Separation in Template Engines"
, Terence Parr defines and push and pull style templating as follows:
DEFINITION 8. A template uses the push strategy if all data
used by the template is computed prior to template evaluation and
is available as a set of attributes ai.
An example of a push-style templating system is
HTML::Template - there is no way to use a streaming iterator within a template. You have to stream all of the data and make it available as a parameter to the template.
DEFINITION 9. A template uses the pull strategy if any data
used by the template is computed on demand by invoking model
functions.
Template is an example of a pull-style templating system. You can freely invoke methods on objects or use iterated streams directly in the template.
my question/meditation
I have heard of people needing to stream large amounts of HTML data, around 1 gigabyte to respond to a single web request.
In that case, what would you do to avoid a timeout while streaming that data into a single memory location? Also, I can imagine a potential memory fault from being forced to pre-fetch an entire stream of data to satisfy push-style templating requirements.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.