thanks for your reply. I think I might need to clarify my question a bit. I don't doubt the MVC pattern itself and I don't want to put business logic inside the controller and . In my example, my business logic is in NonCatalyst::MyClass, i.e. it is completely separate from the controller and the WebApp itself. The controller simply collects data and asks this model class for a result, which it then sends to a view.

My question is, what do I gain from using the Catalyst::Model::Adaptor approach to declare my external class as a model as opposed to simply requiring it in the controller and using it directly. If anything, the Adaptor approach appears to require more code, especially when parameters need to be send to the model.
In addition, my case requires that the model is instantiated once per request (it needs to connect to third-party databases depending on user input), so I would have to use Catalyst::Model::Factory::PerRequest and I can't really see the benefits of that at the moment but I'm new to Catalyst and fully aware that I might be overlooking something here. Thanks for your help!


In reply to Re^2: Trying to understand Catalyst::Model::Adaptor by tospo
in thread Trying to understand Catalyst::Model::Adaptor by tospo

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.