Thanks Phly boy.

    On reflection (as in hindsight rather than a reverse engineered class) I
agree that having a validation chain relating to a domain entity would be a
much neater implementation, than adding validators to a form object. 

It would be easier to test and you get the added benefit of checking
validation outside the context of the form.

I guess the difficult task is to neatly integrate those rules tied to your
domain entity into the form. How do you tell the form which domain
validations to apply to which elements?

Could you map your entity properties to the elements within the form? What
if multiple form inputs make up a single domain attribute (like dd/mm/yyyy
selects)? 

I cant think of a neat solution for connecting these without begining to see
code coupling. The form shouldn't need know anything about the model and
vice versa.

Definately one to ponder.

Lee Davis
http://twitter.com/leedavis81


--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Zend-Form-shifting-validation-off-the-element-onto-the-form-object-tp3436410p3444093.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to