Some more problems:
Issue #2 - Request (and Response) subclassing
This is a problem we encountered in Mason development as well, and I don't know of any great solutions.
The basic issue is that everyone wants a piece of the request (and response) class. It's the logical place to put app-specific per-request/response attributes & behavior. I note that the Catalyst docs seem to encourage you to do this:
{ package Catalyst::Request; __PACKAGE__->mk_accessors('toejam');
sub foo { } }
package VegGuide::Request;
use base 'Catalyst::Request';
use Class::Trait ( 'Catalyst::RequestTrait::REST' ); use Class::Trait ( 'Catalyst::RequestTrait::WhizBang' );
I haven't touched Catalyst in a long time, but when I did, I seem to recall that they implemented plugins via multiple inheritance. I urged them to consider something different, including a trait model. It would have been far more sane, but they were concerned (if I recall correctly) about backwards compatibility. Traits solve so many problems and I wish more people would take a look at them. Of course, it would help if I completely rewrote the Class::Trait documentation.
Re:Traits
sigzero on 2007-03-02T12:47:27
Okay, go ahead. : )Of course, it would help if I completely rewrote the Class::Trait documentation.
The basic issue is that everyone wants a piece of the request (and response) class. It's the logical place to put app-specific per-request/response attributes & behavior. I note that the Catalyst docs seem to encourage you to do this:
Where does the documentation say that?
Re:Documentation...
autarch on 2007-03-02T17:44:40
Right here.
BTW, I'm on the Catalyst list if you want to move this discussion there.Re:Documentation...
phaylon on 2007-03-03T23:46:39
Argh. That was even _my_ fault. I hadn't done that much with Catalyst, and this document is really outdated. Fortunately, I'm about to finish a new version that focuses more on best practices.