Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I'd prefer not to comment directly, given I haven't used it that much. I can tell you what I have done though.

Page templating is done via the autohandler. The autohandler gets called for all page requests, plus it is also done in a hierarchy - if the current directory doesn't have an autohandler, it will go up a level and try the parent. As you can imagine, this makes page templating with overrides for certain web site areas rather easy.

After my autohandler has done the page setup (via broken out components, my autohandler has very little actual HTML in it), I have a line: <% $m->call_next %>. This is where whatever actual object was referenced in the URL starts being displayed/processed.

Thus, my actual documents have very little in them except basic markup. There is no need to have includes for the headers or footers, it's done automatically. I do have:

<%method title>Page title here</%method>
Which propagates up the tree, and is available to my components that generate the actual page headers and so forth.

What I haven't done yet, is any form of user interactivity, though it looks like it will be quite easy handling GET/POST requests. But so no more, since I haven't tried it yet.

Also of note (though I haven't used it yet either) is the caching ability - components can be automatically cached, and only regenerated after certain times. For example, a weather component might generate a chunk of HTML which shows the current temperature. The caching can easily ensure that it only runs say once per hour, calling components receiving the cached output in the meantime. This is a big boon for performance. I'm not sure if this works in non-persisitant (ie non mod_perl) environments.

Lastly, and perhaps most importantly, there is very good documentation available on the web site, and some good tutorials around on other sites as well.

BTW, I probably haven't explained the Mason stuff above too well, Mason diehards are welcome to go postal on any mis-uses of Mason terminology above :-).


In reply to Re: More on Web Application Frameworks by Tardis
in thread More on Web Application Frameworks by impossiblerobot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-19 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found