spaun wrote:

$route = new Zend_Controller_Router_Route_Regex(...);
$route->setAssembler(new MyAwesomeUrlAssembler());
$router->addRoute('archive', $route);

It's a nice idea, really. If it was Java or any other compiled language I wouldn't hesitate here for a moment, but...

Is it really necessary? Wouldn't it be easier to just extend the route and override assemble method? The work you have to do is almost the same and this way we avoid loading and parsing of approximately 2-4 additional files (interface plus one assembler for every registered route type).

I know one should prefer composition over inheritance but routes are just a tiny part of MVC. And because of overhead of parsing additional code (in new as well as in older classes) and loading more php files it's just not worth the effort here. In my humble opinion, of course.

If you have an idea on how to improve regex route assemble method, then maybe it would be better to contribute your idea and help improve the core framework itself?

--
Michał Minicki aka Martel Valgoerad | [EMAIL PROTECTED] | 
http://aie.pl/martel.asc
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Idleness is not doing nothing. Idleness is being free to do anything." --
Floyd Dell

Reply via email to