[Catalyst] An MVC logic separation conundrum

Chris Welch welch.chris at gmail.com
Thu Mar 10 12:59:42 GMT 2016


On 10 March 2016 at 12:42, Aristotle Pagaltzis <pagaltzis at gmx.de> wrote:

> * Chris Welch <welch.chris at gmail.com> [2016-03-09 20:10]:
> > All of this brings up a quandary: there are only two ways around this
> > that I can see:
>
> There’s plenty more. E.g. you could have generate_ical_data expect one
> or several callbacks to generate those values for it, something like
>
> ​​
>     $match->generate_ical_data(
>         get_uri         => sub { $c->uri_for_action( ... ) },
>         get_description => sub { $c->maketext( ... ) },
>         # ...
>     );
>>

​Oh I very much like that - I *knew* ​I had to be missing a better way of
doing it, I bow to your superior ideas, thank you very much.

Thinking about it: any way you would pass in an anonymous sub rather than
the return value from the actual methods - i.e.:

​
    $match->generate_ical_data(
        get_uri         => $c->uri_for_action( ... ) ,
        get_description => $c->maketext( ... ) ,
        # ...
    );
​


​Thanks again.​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/catalyst/attachments/20160310/8f56897c/attachment.htm>


More information about the Catalyst mailing list