[Solar-talk] Sub-controllers re-visited [long]

Paul M Jones pmjones at ciaweb.net
Mon Nov 19 09:24:20 CST 2007


On Nov 18, 2007, at 9:43 PM, Clay Loveless wrote:

> On Nov 18, 2007, at 12:57 PM, Rodrigo Moraes wrote:
>
>> This is what I think too. A custom front controller would solve the
>> problem in a more comprehensible/natural way.
>
>
> Something I'm trying to avoid is layers of logic that most requests  
> have to step through in order to solve the issue surrounding this  
> one particular problem.
>
> As Antti said, this comes up for everyone ... but, it seems to come  
> up only occasionally. To stack even more stuff on the front  
> controller that every request has to pass through is a high price  
> to pay for the occasional scenario.

Agreed on all those points, and see my comment below about "as- 
needed" routing.


> Paul can confirm this, but I believe that one of the primary  
> reasons Solar smokes the other frameworks out there is that is does  
> not force every request, many of which only have simple "routing"  
> needs, through a front-controller router.

I think that is the case, or at least part of the case ... but that's  
only my intuition, an unproved assertion at best.


> An odd, but ultimately more efficient from the raw speed  
> perspective, is a routing facility that can be applied on a more as- 
> needed basis than the shotgun approach that is an addition at the  
> front end.

I was just thinking that.  :-)  It would be possible to have a front- 
controller that looks for the specific Disaster leading URI  
component, and switches logic on that.  You could, for example,  
extend Vendor_Controller_Front from Solar_Controller_Front, and have  
it check just the first element of the URI; if it's  Disaster call,  
do some added processing, otherwise go with the parent  
Solar_Controller_Front processing.  (Does that make sense?)




--

Paul M. Jones  <http://paul-m-jones.com>

Solar: Simple Object Library and Application Repository
for PHP5.  <http://solarphp.com>

Join the Solar community wiki!  <http://solarphp.org>

Savant: The simple, elegant, and powerful solution for
templates in PHP.  <http://phpsavant.com>




More information about the Solar-talk mailing list