Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Data, Logic, Display: The Multi-Tiered Decoupled Approach to Web Design

In Refining the CGI process through structure and templates, boo_radley does state:
A good CGI framework should provide 1.Template handling -- go TT2! Keeping templates divorced from code allows me to to farm out HTML and probably SQL, not to mention benefits of maintenance, etc
But one must ask. Does Template force one to separate Perl and HTML? The answer is no, it does not. In fact, anything you can do in Perl, you can do using the [% PERL %] Template directive.

Furthermore, Template exports a mini-language, containing loops and conditionals and simplified methods of defining Perl hash and array refs. And beyond that, people have written plugins to extend this mini-langauge even further to support database interaction among other things.

So, with Template as your templating solution, you have Perl and Template as programming languages and then you have HTML.

On the other hand HTML::Template has far more limited mini-language, forcing one to do much more in pure Perl.

Web App Frameworks and Their Chosen Template Engine

OpenInteract made by our own lachoy. Template
boo_radley's framework Template
CGI::Application HTML::Template
CGI HTML::Template --- this is not entirely true. What is true is that HTML::Template @ISA qw(CGI) And therefore anywhere that you use HTML::Template you are already using CGI.
Apache::PageKit HTML::Template
AxKit XPathScript or XSLT (your choice)
CGI::MxScreen None --- use what you want
HTML::EP Builtin --- has a Perl tag (uh-oh). Is extensible (uh-oh#2).
BingoX Builtin --- has a Perl tag (uh-oh). Is extensible (uh-oh#2).
CGI::Portable It's can't figure out what it has.
LibWeb I can't figure out what it has!
HTML::Embperl and HTML::Mason Perl. That may sound funny but that's how these two modules do it. Of course you can develop your own HTML display modules in Perl and use them inline.

Conclusion

In my eyes, Template is offering replicated functionality through its too-powerful and too-feature-packed mini-language. There is nothing that this mini-language offers that cannot and should not be done in re-usable Perl modules.

On the other hand, HTML::Template by creating a very narrow snake's tube between Perl computation and HTML display, forces one to use Perl for it's strength and HTML for it's without any chance for the feature overlap phenomenon that has happened with Template.


In reply to Web Application Frameworks and their Templating Engines with a Comparative Study of Template and HTML::Template by princepawn

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 surveying the Monastery: (3)
As of 2024-03-28 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found