|
in reply to Push templating strategy cannot violate separation in thread RFC - Template::Empty
I still don't think your getting it. All "push" style has done is moved the "pull" into your perl layer. Seamstress requires too much knowledge about the template. TT is closest to give true separation because you can give it unblessed, raw, unformatted data. Anything that is not passed as unblessed, raw unformatted data has violated the separation - but that doesn't make it bad - it just makes it not academic.
I don't think at this point that you will ever concede. I am somewhat saddened (but not that much) that you fail to see that Seamstress (and most likely all "push" systems) violate the separation of model and presentation in the exact opposite direction of "pull" systems.
Well - I really must get back to work and my non-academic template implementations.
Update - I think the problem here is when we are using the term "view." For me, the view is very nearly tied directly to the html/xml/text template with the TT or Template::Alloy object swapping in data that was prepared by the model and handed to the view by the controller. Your implementations of the view seem to include sections of Perl code that know what the template needs - and even more it knows what the template looks like, and then requests data from the model in the formats that the template needs - depending upon the model to get it into shape. This is where the argument comes in. TT models don't need to have Perl code as part of the "view" layer. Seamstress requires it. In the end we are arguing over borders which really is an inconsequential debate. Both models work equally well in the eyes of the end user (who never sees the code that generated the page). Both camps will be forever wrong in each others eyes. True separation is a decoy issue at best.
my @a=qw(random brilliant braindead); print $a[rand(@a)];
Clarifying the rhandom-perrin attack
by metaperl (Curate) on Feb 26, 2008 at 19:02 UTC
|
Update - I think the problem here is when we are using the term "view." For me, the view is very nearly tied directly to the html/xml/text template with the TT or Template::Alloy object swapping in data that was prepared by the model and handed to the view by the controller.
right. A Seamstress view is 2 things. A Perl View module and a lifeless HTML file.
Your implementations of the view seem to include sections of Perl code that know what the template needs - and even more it knows what the template looks like, and then requests data from the model in the formats that the template needs - depending upon the model to get it into shape. This is where the argument comes in.
Right this where the rhandom-perrin attack comes in: "the perl code is tightly tied to the HTML" -- and the flaw in the attack is the term "the perl code" ... the View makes use of the HTML, but the View and "the perl code" are not synonomous. And there is nothing about Seamstress which prevents multiple views of the same HTML file or multiple representations of the model.
Dynamic HTML generation is not the Achilles Heal of object-oriented Perl. It is one more domain in which it thrives.
TT models don't need to have Perl code as part of the "view" layer. Seamstress requires it.
Let's be precise. TT views are converted to Perl before execution. Seamstress views are manually written before execution. In both cases, Perl code is accessing the model. The difference is that one tool automatically generates that Perl and the other makes use of heavily object-oriented Perl to do so.
In the end we are arguing over borders which really is an inconsequential debate.
Perhaps, but it certainly was stimulating.
Both camps will be forever wrong in each others eyes.
I dont think TT is wrong. TT is serving 1 million hits a day at minimum. How can that be wrong? Now it is certainly not my cup of tea and as a result you will never catch me at Ticketmaster, or working at the same job as perrin or yourself, but you guys have results. I have theory, one corporate level success, and a fierce determination to keep the approach alive.... I'm a Haskell lover caught in a Perl job world. I'm not quite good enough will the Haskell approach to take it live. But I'm far too oriented to that way of thinking to use things like mason and TT.
| [reply] [d/l] |
|
|
| [reply] |
Model-View-Controller is natural with HTML::Seamstress
by metaperl (Curate) on Feb 26, 2008 at 18:37 UTC
|
All "push" style has done is moved the "pull" into your perl layer.
Au contraire. It has guaranteed well-formed HTML. As well as the other benefits mentioned in the Seamstress docs.
Seamstress requires too much knowledge about the template.
You created the proving grounds. I met the challenge. Please point to the part of the code with "too much knowledge about the template".
TT is closest to give true separation because you can give it unblessed, raw, unformatted data.
Yes, but you give TT "blessed, cooked, formatted" HTML? You go into the HTML and put various things there. You rip apart the HTML into files.
Anything that is not passed as unblessed, raw unformatted data has violated the separation - but that doesn't make it bad - it just makes it not academic.
If the definition of the model were raw, unformatted data, yes. But it is not:
Model:
The domain-specific representation of the information on which the application operates. Domain logic adds meaning to raw data (e.g., calculating if today is the user's birthday, or the totals, taxes, and shipping charges for shopping cart items).
In other words, the raw data is adopted into the model on domain-specific terms. This adoption in my case involved blessing the object into a class which would handle all operations for this domain-specific interpretation of raw data.
Note that Catalyst also backs me up. It has very high-level Model and View classes that dispatch to your Model and View classes which then manipulate the raw and unprocessed data.
| [reply] [d/l] |
|
|
| [reply] |
|
|