Dear monks,

Would any of you know where I can find an example/tutorial showing the use CGI::Prototype? The best I've found is the CGI::Prototype::Hidden that comes with the distribution, but it would help me a lot to look at a fuller example.

I have read merlyn's article discussing this module, but the source code that goes with this article consists only of a few isolated fragments for illustration. Also, I have read various perlmonks.org posts on CGI::Prototype, but I'm still not clear how one uses this module.

My biggest obstacle is Class::Prototyped (the superclass of CGI::Prototype). I understand the basic idea behind Self-like objects, but I don't understand why one would want to use them in place of regular Perl objects. It's clear from the article that Class::Prototyped's functionality is central to the "CGI::Prototype vision", but with the exception of the line

our $_mirror = __PACKAGE__->reflect;
at the top of the file, I don't see how CGI::Prototype::Hidden uses the fact that it is a subclass (or rather a subsubclass) of Class::Prototyped.

One problem I already see with the implementation of CGI::Prototype is that potential users not only must become familiar with it and with the Template Toolkit (which seems to me a reasonable thing to expect of a hard-working, underpaid CGI programmer), but must also become familiar with the workings of Class::Prototyped, even though this class has intrinsically nothing to do with writing CGI applications. I think users of CGI::Prototype should not have to know anything about Class::Prototyped to use CGI::Prototype effectively.

the lowliest monk

PS: I've also looked at CGI::Application, but I like C::P's MVC approach more than C::A's run mode approach. Granted, there's more stuff out there on how to use C::A, so I may ultimately go that route, but I'd like to give C::P a try first.


In reply to Seeking enlightenment on CGI::Prototype by tlm

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.