" Catalyst to serve a static file (which would only make sense if there *is* 
application logic) putting this in a View would be the Right Way."

Yes my point exactly. That’s why I was comparing it to serving static image 
files and how it's similar to this situation because there seems to be no 
application logic at all needed for this example so putting it in a view just 
to follow the design pattern does not make sense to me. That’s why I gave the 
previous example as an example of overkilling with the design pattern where it 
really serves no purpose. I completely agree that it makes much more sense to 
leverage the webserver for dealing with static files when necessary/possible. 

Thanks,
------------------------------------------
Ali Mesdaq (CISSP, GIAC-GREM)
Sr. Security Researcher
Websense Security Labs
http://www.WebsenseSecurityLabs.com
------------------------------------------


-----Original Message-----
From: J. Shirley [mailto:[email protected]] 
Sent: Friday, March 05, 2010 12:20 PM
To: The elegant MVC web framework
Subject: Re: [Catalyst] Best practices: XML output from static XML

On Fri, Mar 5, 2010 at 11:31 AM, Mesdaq, Ali <[email protected]> wrote:
> To me this sounds like it’s the same issue as serving static images you
> wouldn’t create a view for that unless you need to wrap it around some
> application logic. Or at least that’s what it sounds like to me based on the
> information provided. We could take the MVC concept really far and say that
> static files need to have a filesystem Model with Controller logic for
> finding the files and each have their own View for each filetype.
>
>
>

I would say that putting it into a view allows a greater degree of
future-proof and foresight.  Putting it into the controller would work
fine, up until you need to serve another static file (or a different
file), or add an access control layer, or switch to use sendfile, or
switch to start serving from something like MogileFS.

If you put it all the above in one method, why put it in a controller
rather than a view?

In all of what you said you haven't actually said what is wrong with
using a view.

I would certainly recommend that serving static files would be done by
the webserver and render this moot.  However, if you want to use
Catalyst to serve a static file (which would only make sense if there
*is* application logic) putting this in a View would be the Right Way.

-Jay

_______________________________________________
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/


 Protected by Websense Hosted Email Security -- www.websense.com 

_______________________________________________
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