Yes, content wrapping rocks. I've been told by a resident TT person that
TT can do something similar to that, but I haven't seen it done before.
This is one of the main reasons I like Mason.
The other reason I like Mason is its component model. Components in
Mason are scoped. So if you want a variable to be available in a
subcomponent you pass it. There are no globals. This is one reason I
don't like PHP. It doesn't do scoping for includes (as far as I know).
This is slightly less valuable when using Mason with Maypole than it is
when using Mason stand alone. And in fact it would be nice to be able to
do Maypole subrequests using Mason syntax. That may work with
MasonX::Maypole, but I don't know because I haven't used it.
The other reason to use Mason is that you don't have to learn a new
syntax. If you know Perl you can use Mason very easily. A for loop is a
for loop.
I don't know if TT does caching of compiled templates, but Mason does.
This helps to speed things up a bit. I've written a patch to make Mason
do this in Maypole. I don't know if its been applied.
I've used both and they've both got plusses and minuses. The Mason
factory templates were a bit buggy when I started so that's a minus
(that may be fixed in 2.0?). TT support is probably better for Maypole.
When it comes right down to it the main reason I picked Mason is because
I've been using Mason heavily for the last 4 years and am very familiar
with it.
David R. Baird wrote:
>Maypole _should_ be templating system agnostic, in that it's trying
>to implement an MVC architecture. However, it makes an assumption
>about how templating systems work that is not necessarily true of
>Mason (although it can be). This is that you can pass data in to the
>template, run it, gather the output, and then send the output
>yourself. You can do that with Mason, which is how
>Maypole::View::Mason works.
>
>However, most implementations of Mason send the output direct from
>Mason to the webserver and out (Mason normally prints rather than
>returns its output). MasonX::Maypole rewires the Maypole request so
>that it doesn't expect to receive HTML output back from the template.
>
>As for which is better, that's a different discussion. I like Mason
>and know nothing about other templating systems, so I can't really
>comment. But I will :-) The big feature that I _think_ Mason has that
>is unique (not sure though - somebody please correct me if I'm wrong)
>is content wrapping. Basically, you get headers and footers
>automatically added to your templates without having to put any hooks
>in to the template itself to pick them up. That turns out to be a big
>deal, and I'd want it in any templating system I was using.
>
>
>d.
>
>
>
>On 8 Oct 2004 at 10:13, Jay Strauss wrote:
>
>
>
>>Hi,
>>
>>Total newbie to Maypole, Mason, TT.
>>
>>I'm trying to avoid going down a tough road. I want to build a Maypole
>>app. Most (all) of the docs are built around TT. And from what I've
>>read it seems that most people use TT with Maypole.
>>
>>But, last night I was at a Mason presentation (by the local perlmongers
>>group), seems pretty nice (especially with no frame of reference for
>>comparison :).
>>
>>(I know what I'm about to say is potentially a holy war charged
>>question, I really don't mean for it to promote that). Which templating
>>system would you recommend to me, a newbie, to use with Maypole? I'm
>>not worried about the TT vs Mason learning curve (that curve is a
>>given). I'm more concerned about the ease of use, compatibility with
>>Maypole.
>>
>>Additionally I see there is:
>>
>>MasonX::Maypole
>>and
>>Maypole::View::Mason
>>
>>Without knowing anything, I can't tell the difference between the 2. Do
>>they do different things, or are they TMTOWTDI
>>
>>Thanks mucho
>>Jay
>>
>>_______________________________________________
>>maypole mailing list
>>maypole at lists.netthink.co.uk
>>http://lists.netthink.co.uk/listinfo/maypole
>>
>>
>
>
>
>
>
>
_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole
This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT