As data in your application may come not only from web forms but also as a
result of asynchronous requests or REST requests you can implement some sort
of mediator to validate your domain object.

You can then use this mediator to validate a domain object, retrieve a set
of errors for domain object properties and then push the validation messages
back into the form to display errors.

This allows you to also validate your domain object at times when forms are
not around.

Here's Matthew's blog post that suggests using Zend_Form coupled with your
domain object: 
http://weierophinney.net/matthew/archives/200-Using-Zend_Form-in-Your-Models.html

And Benjamin Eberlei in turn suggests to use a mediator:
http://www.whitewashing.de/blog/109


--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Service-Layer-and-form-validation-view-interaction-tp3336281p3337521.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to