Hello DC.
[quoted text, click to view] > the client does
> one pass - basic validation, applying general rules based on fields. For
> example, if the field is a date, it must be a legal date. The server does
> more rigorous validation - does the account start date fall after the
> accountholder's burthdate
I thought about separate validation rules in such manner. There is one
thing that confuses me. Validation on the server will be performed
after all data is entered by user in the client application, isn't it?
So user inputs data and press 'OK'. Server performs some validation
(client-side validation is ok) and returns some error. Users fixes this
error and press OK again. Server could find one more error if server
validation rules are complex enough. Server validation could return
more and more errors when user is expecting that all fine. It could
make user going crazy ;) IMHO
If all validation rules are placed on the client-side we could add
checking user input in OnChanged event for GUI controls and user could
see some warnings and error messages on screen while filling the form.
I think it would be more user-friendly design than validating on OK
button.
Client could ask server to perform validation for data each time when
user changes it, not only on OK of course. In such case I see next
trouble - rich network traffic between client and application server
and many remote calls. This will slow down GUI response on user input
:(
To join complex validation on server strategy and validation on data
change I 'd like to validate data on server when GUI control lost
focus. So if there is 5 GUI controls on the form each time when user
switches from one control to another DTO will be passed from client to
the application server and validated. I think that such validation
strategy will be best choice. Tell me please what do you think about
such design?
How validation was performed in the projects that you have seen? On OK
button or when user changes the data (in OnChanged event server
validate is called)? Was there problems with many remote calls to
perform validation? How does user react when server returns errors
again and again?
Thank you.