Okay. I thought you were being a bit… contrary. But it's a real question and a real concern. To address it might take volumes though. …trying to boil down… …working… …loading…

Non-colliding namespaces are cheap, nearly free, in Perl. The main point of MVC is organizing concerns, organizing thought. Interpreter don’t care. Dev does. The controller should do nearly nothing. Really. Including hardcoding itself. uri_with, uri_for, and uri_for_action make the controllers themselves terribly flexible. Fat models (where the business logic is part of the data control) are the most reusable and therefore the obvious choice. Views should do all the branching of what is sane to show. The Controllers therefore do only the most obvious filtering, dispatching. A controller sub longer than… 40 lines is probably in need of abstraction or not relying enough on the M and the V.

Let’s pick a more reasonable idea than Games::Dice. Let’s try LWP::UserAgent. Now your Controller classes are *littered* with has "ua" =>,  my $ua = …, and such. Completely uncool but obvious, understandable, readable. Then you decide you wanted to do a bit more and want to update to WWW::Mechanize. You have 20 Controllers and hundreds of lines of code to change, validate, test, and pray; maybe more if you were using default headers or something. Or you adjust the base class of your Model. The point of something as grand as Catalyst is growth. If you don’t care, or won’t grow, then bare Plack/PSGI is there or Mojolicious::Lite, etc. Gratuitous “best practices” are only gratuitous if the code is throw-away.


In reply to Re^10: Understanding Catalyst by Your Mother
in thread Understanding Catalyst by QuillMeantTen

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.