Hi,
thanks for your work on this component!
There is only one issue, about which I'm not sure if it is adressed by
the request filter or not.
I consider it to be very important for clean code to separate the input
validation from any action or logic. This can be best reached by having
different methods for this two tasks.
The actual controller action method should be invoked only with verified
data and should not have to care whether the data is clean. This could
be reached by putting the input data in individual request objects which
are guarentied to contain only verified data:
class myBookingDataConfirmationController
{
public function run( myBookingDataStruct $data )
}
A separate method class is responsible to validate the request data
and to build a myBookingDataStruct from the request. Think of an
ezcInputForm class as an example for such a validator.
Because the validation could fail, we need another method in the
controller:
public function onValidationFailed( myValidator $failedValidator,
ezcMvcRequest $request )
This method is then responsible for showing the error message.
The magic validator should also be provided by the controller, like:
public function getValidator( $protocoll )
I think that it would also be handy for SOAP interfaces to exactly
specify the kind of data that a controller expects.
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
[email protected]
http://lists.ez.no/mailman/listinfo/components