Posted: Thu Oct 06, 2005 8:14 am
Exercising the brain.
I think the CommandFactory should be pushed into the RequestMapper. A Request object separated from the RequestMapper (to include the Input Filter from the IF Chain). The FrontController would be passed either the Request or Request Mapper.
It gets a bit complex here since then the RequestMapper would need the Request object in order to parse the "action" key from GET/POST and return a Command object (using a Command Factory) for the FC to process.
I'm kind of seeing the Request as a Singleton - whether that's a good idea or not, it would have to be widely passed around without. As for the initial instantiation.. sure there are improvements but:
...where Request is instantiated as a singleton (only require one instance anyway). The instantiation chain bit is a bit odd looking though
.
I think the CommandFactory should be pushed into the RequestMapper. A Request object separated from the RequestMapper (to include the Input Filter from the IF Chain). The FrontController would be passed either the Request or Request Mapper.
It gets a bit complex here since then the RequestMapper would need the Request object in order to parse the "action" key from GET/POST and return a Command object (using a Command Factory) for the FC to process.
I'm kind of seeing the Request as a Singleton - whether that's a good idea or not, it would have to be widely passed around without. As for the initial instantiation.. sure there are improvements but:
Code: Select all
$front = new FrontController( new RequestMapper( Request::getInstance() ) );
$front->execute();