Am Montag 30 Juni 2008 11:08:02 schrieb Tobias Schlitt: > >> ezcMvcRequestFilter > >> ------------------- > >> > >> The filters are described to be used in a method named > >> ezcMvcController->runRequestFilters(), while this method should be > >> called by ezcMvcController->run(). It does make little sense to me to > >> mention that a method ezcMvcController->runRequestFilters() should be > >> implemented at all, if the controller calls the filter itself. > >> > >> Instead I would suggest to design it in either of the following ways: > >> > >> a) Remove the ezcMvcController->runRequestFilters() part and just > >> mention that filters should be run by the controller. > >> b) Require the method ezcMvcController->runRequestFilters() in the > >> interface and make it be run by the request builder. > > > > The reason for not calling the interface methods just run() is so that > > you can implement all the three filter interfaces in one class: > > > > ezcMvcAuthenticationFilter implements ezcRequestFilter, ezcResultFilter, > > ezcResponseFilter. > > > > The filters should indeed just be run by the controller from the run() > > method in some way. I think you're right that we can just remove it. > > (your point a). As for b, that would be a bad idea, as the request > > builder doesn't actually run the controller, but just returns the > > request object. The dispatcher calls the controller with this request > > object. How the controller runs the filter, should not really matter - > > however, I think it would be good to standardize it, and thus leave it > > in the interface like we've currently designed. > > If we go for standardizing it, then why not simply make the dispatcher > run that stuff? This avoids having all controllers run this methods.
This is exactly the point that I had in mind with my email "Input Validation separated from Controller" and I agree with Tobias here. Another point is: If runRequestFilters() is called by run(), then the runRequestFilters() method is bound to run() and it is harder to test them separately. Best regards, -- Thomas Koch, Software Developer http://www.koch.ro Young Media Concepts GmbH Sonnenstr. 4 CH-8280 Kreuzlingen Switzerland Tel +41 (0)71 / 508 24 86 Fax +41 (0)71 / 560 53 89 Mobile +49 (0)170 / 753 89 16 Web www.ymc.ch -- Components mailing list Components@lists.ez.no http://lists.ez.no/mailman/listinfo/components