<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066">Hi</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066">This is more of a general MVC question, but hopefully it&#39;s okay to ask in here.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066">I&#39;ve set up a model to generate data in iCal format (see my previous thread and thanks for the responses on that), but it has thrown up an interesting general logic separation question that I don&#39;t know the answer to.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066">By way of an example, I&#39;m generating iCal events for a data table called team_matches (DBIx::Class model name TeamMatch).  I was hoping, as would seem to be the cleanest way to do it, to have a result class &quot;helper&quot; method, such that on each match object I could call something like: $match-&gt;generate_ical_data, which would generate a hashref of calendar values to be passed through to my MyApp::Model::ICal module that will generate the actual data.  The problem with this is that certain properties require access to the Catalyst application: for example, there&#39;s a uri property, the value for which will need to be generated by $c-&gt;uri_for_action and since this particular application has the ability to be multi-language (via CatalstX::I18N) the description value needs to be generated by $c-&gt;maketext.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066">All of this brings up a quandary: there are only two ways around this that I can see:</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066">  * Pass $c into the $match-&gt;generate_ical_data method (which I know is STRONGLY discouraged and very very bad).</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066">  * Generate the hashref in the controller (which potentially makes for a &#39;fatter&#39; controller than you ideally want and I&#39;m trying to stick to the ideals here).</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066">I&#39;m guessing the preference of the above options should really be the latter (which is what I&#39;m currently doing in the interim), but I am hoping that there&#39;s a super-clever way that I&#39;ve not thought of that someone can tell me I&#39;ve completely overlooked?</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066">Thank you in advance.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#000066">Chris</div></div>