If you don't have a lot of view only logic (the view is just a dumb 'take this 
perl data structure, convert it to a display format using default serialization 
rules and send it to the response) then a thin view adaptor with 
Catalyst::Model::Adaptor might be the easiest thing.  If you are using the most 
recent Catalyst you could even avoid the need for a boilerplate proxy class 
using component injection.
Then main thing is thinking about how to shuffle data to the view.  Most 
current art uses the stash, but lately I prefer to avoid that and use either a 
dedicated view model, or the default model, so that I can properly constrain my 
data and offer the view better view only logic.
In general think 'how can I do something generally useful' over 'what is the 
Catalyst way to do this'.  Ideally your Catalyst components (models, views, 
etc) are the thinnest possible layer to adapt a stand alone model.
jnap 

    On Friday, March 4, 2016 4:28 AM, Kieren Diment <[email protected]> wrote:
 

 looks to me like you'd want Catalyst::Model::Adaptor + Data::iCal + an 
optional very thin view that did something like:

    $c->res->content_type($ical_content_type);
    $c->res->body($c->stash->{calendar});

in the process method, and not much else.

The reason you don't see views for stuff like this much in catalyst land is 
that this kind of thing is usually pretty simple.

On Fri, Mar 4, 2016 at 8:22 PM, Chris Welch <[email protected]> wrote:

Thanks for the reply - may I ask what the model would be doing, given that 
presumably it would have to go through a view in the end anyway?  Because the 
data itself already exists in a model, all I'm wanting to do effectively is 
extract that and display it in a slightly different format, so I'm surprised 
that another model is the way to go - but then I've sort of been learning as I 
go with this stuff, so I may well be missing something fundamental!
Thanks
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/




_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/


  
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to