Greetings,<br><br>I've had a look at Catalyst and RoR from a basic point of view and like both. I'm also familiar with the concepts of MVC but again, from a basic point of view. I'm also busy learning design patterns etc. <br><br>So, my head is full and maybe I can't see the wood for the trees in what I'm about to ask.<br><br>I'm 100% happy with what should go in the View part of MVC, 90% sure of what should go in the Controller and more than confused about what should go in the Model (not exactly true)<br><br>I searched the Catalyst mail archives about 'best practice' and came across this (amongst others) and read it in full<br><br>http://www.gossamer-threads.com/lists/catalyst/users/1081?search_string=best%20practice;#1081<br><br>......... leaving me not confused but with lots of questions.<br><br>I've already started my new application and I've set it up like this ...<br><br>lib/P4C/Controller/SelectProduct.pm<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 /Model/Product.pm<br>&nbsp;&nbsp; /P4CSchema/Product.pm (amongst others)<br>&nbsp;&nbsp; /P4CSchema.pm<br>&nbsp;&nbsp; /P4C.pm<br><br><br>Now, when selectproduct action is called, I want to select all products that match a criteria. In the Catalyst examples, this would be done simply as ........<br><br>$c-&gt;stash()-&gt;{products} = [$c-&gt;model('P4CSchema::Product)-&gt;all()];<br><br>and all would be happy in the world.<br><br>But, I might want to do some work on those results before stashing them away so, I may decide to do this in the Controller .......<br><br>my $prod = Model::Product-&gt;new();<br>$c-&gt;stash()-&gt;{products} = [ $prod-&gt;get_all_products_that_like_me() ];<br><br>and in Model::Product I'd have something like this (maybe)...<br><br>sub get_all_products_that_like_me() {<br>&nbsp; my $self = shift;<br><br>&nbsp; ## what's the use of schema in this command when it works okay without?<br>&nbsp;
 ##$self-&gt;schema()-&gt;resultset('P4CSchema::ProductGroup')-&gt;all();<br>&nbsp; my $prods = $self-&gt;resultset('P4CSchema::ProductGroup')-&gt;all();<br><br>&nbsp; return $self-&gt;do_you_like_him( $prods );<br><br>}<br><br>But, is this the right place to put this logic as, I have read on the mailing list that people would use Model::* as a wrapper to the business logic code that is elsewhere.<br><br>So, would this be better (haven't thought this through because as I said, my head is too full) ? .............<br><br>lib/P4C/Controller/SelectProduct.pm<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /Model/Product.pm<br>&nbsp;&nbsp; /P4CSchema/Product.pm (amongst others)<br>&nbsp;&nbsp; /P4CSchema.pm<br>&nbsp;&nbsp; /P4C.pm<br>&nbsp;&nbsp; /Logic/Product.pm<br><br>and have in Model::Product one of.....<br><br>use base qw|Logic::Product Catalyst::Model::DBIC::Schema|; <br>use base qw|Catalyst::Model::DBIC::Schema Logic::Product|;<br><br>and let Logic::Product do the
 ....... <br><br>sub get_all_products_that_like_me() {<br>&nbsp; my $self = shift;<br><br>&nbsp; ## what's the use of schema in this command when it works okay without?<br>&nbsp; ##$self-&gt;schema()-&gt;resultset('P4CSchema::ProductGroup')-&gt;all();<br>&nbsp; my $prods = $self-&gt;resultset('P4CSchema::ProductGroup')-&gt;all();<br><br>&nbsp; return $self-&gt;do_you_like_him( $prods );<br><br>}<br><br>Is that's what meant by 'wrapper'?<br><br>Phew, okay, that's it for now. I have my flame pants on, so go ahead ;)<br><br>Many thanks<br><br>-Ants<p>&#32;


      <hr size=1> 
Yahoo! Mail is the world's favourite email. Don't settle for less, <a
href="http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html">sign up for your free
account today</a>.