[Solar-talk] Solar + Solar = 100% compatible, 100% more flexible

Antti Holvikari anttih at gmail.com
Thu Nov 30 12:43:03 PST 2006


On 11/30/06, Rodrigo Moraes <rodrigo.moraes at gmail.com> wrote:
> Hi,
> Last night I was reading the chapters about controller and routing
> mechanisms in a rails book, and after a cup of coffee I was looking at
> how Solar_Controller_Front and Solar_Controller_Page deal with
> requests. After some hours mixing and moving controller parts, I got a
> proposal that is 100% compatible with existing Solar apps, and it is
> much more flexible too.
>
> The interesting thing is that there is almost no new code, only moved
> parts from Solar_Controller_Front and Solar_Controller_Page to the new
> Solar_Controller_Router and Solar_Controller_Dispatcher. These classes
> are largely inspired by observations of ZF's controller, but the
> similarities are restricted to the concepts and some method names; the
> implementation is very "Solarified" and actually, as I said, it is
> based on existing Solar code, refactored and moved to work on better
> places and times.
>
> So, what's the idea? Currently, Front and Page controllers share the
> task to map requests to a given controller/action. The Front
> controller finds the controller, and the Page controller finds the
> action. We take these tasks from them and place them somewhere else.
> The Router reads the uri and dumbly returns a mapped
> controller/action/info to the Dispatcher, which them instantiates the
> controller and the action (after the usual checks).
>
> So, where is the new code? Yes, this is funny, there is almost no new
> code. There are basically some things moved from existing Solar code.
> Please take a look and try it. I'm sure there are lots of improvements
> to be done, but I hope this is a good start. I'm really happy because
> this resulted from Solar mixed with Solar itself to forge a 100% more
> flexible Solar, and also 100% backwards compatible Solar. See? A lot
> of Solar. :)
>
> So here's the code and some more words:
>
> http://solarphp.org/wiki/proposals/dispatcher

As we discussed this in IRC with Rodrigo, this makes it impossible to
use Solar apps without the front controller which is the case with
zend fw too. Maybe we can work around this, or not, if we don't want
to.

Just my $0.02.

-- 
Antti Holvikari <http://phphalo.com>


More information about the solar-talk mailing list