>
> 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 )
> }


This would be a good thing to do as a subclass, but I don't know if I'd want
to see this on the base interfaces. The stick issue is that what determines
whether or not the data is 'clean' is highly application-specific. There
would need to be an additional layer that defines what data should be
accepted for each controller action.

Given the current spec, though, I think that it would be pretty each to
write custom subclasses for RequestParser, Controller, and an input filter
that implements this behavior.

-- 
Joe Kepley
Director of Development
-------------------------
Blend Interactive, Inc.
http://www.blendinteractive.com
-------------------------
136 S. Dakota Avenue
Sioux Falls, SD 57104

o: 605.334.7077
m: 605.728.6550
f: 866.686.5491
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to