tag:blogger.com,1999:blog-36345871.post3106654859725567747..comments2023-07-11T05:39:57.966-07:00Comments on Perl Alchemy - notes of a programmer: The Catalyst APIzbyhttp://www.blogger.com/profile/04636763782334128869noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-36345871.post-73004953910903961372009-08-07T13:49:35.649-07:002009-08-07T13:49:35.649-07:00$self in actions is also used if you ever specify ...$self in actions is also used if you ever specify controller config; the controller is the object that will have it.hobbifiedhttps://www.blogger.com/profile/17095482184817297654noreply@blogger.comtag:blogger.com,1999:blog-36345871.post-3542400526426516832009-08-07T08:38:51.524-07:002009-08-07T08:38:51.524-07:00I did not say that we should get rid of that param...I did not say that we should get rid of that parameter - only that it is nearly never used nor explained in the docs. I am now convinced that context should be actually an attribute on that controller object - this way we could eliminate the other always passed on parameter, and I am sure people will find more usage for it once we start the discussions.zbyhttps://www.blogger.com/profile/04636763782334128869noreply@blogger.comtag:blogger.com,1999:blog-36345871.post-15220497133175902332009-08-07T07:30:07.864-07:002009-08-07T07:30:07.864-07:00I use $self regularly. Usually, I end up having a ...I use $self regularly. Usually, I end up having a controller base class, and sometimes I apply roles to controllers too.<br /><br />The base class and/or roles will contain common operations like doing a fulltext search of some thing (the thing depending on controller), common authz operations, etc.<br /><br />Think of the controller object as the thing responsible for handling the request, and the $c object as the request context itself.<br /><br />What Catalyst gets wrong is that $c is both the request context <i>and</i> the application. The Catalyst devs know this is wrong, which is why the roadmap includes a plan for an application/context split, something I very much look forward to.Anonymousnoreply@blogger.com