I am looking for an optimal approach to how to do UI validation in the model-view-presenter architecture.
I need to check out some forms with lots of controls. To facilitate the task for the user, I save all errors or warnings with a link to the control in the log, which is then displayed to the user so that he can immediately go to the control that he needs to fix. This is done in the part of the view, which is actually incorrect, since validation must be carried out in the presenter for the exchange of viewing.
The problem that I am doing this check in the presenter is that it does not just check if the indicated values ββare incorrect, but it is also necessary to check if the radio objects were checked, which allows using a text field, which should then contain some text for example.
I thought about using the BindingSource in the presenter, as it reflects the user interface changes and is visible to the presenter. But I'm not sure if this is the right way (and I think it is disgusting)?
By the way: validation takes more than just space before I write to the database; this is already happening when the user is working on forms.
Can anyone think of a good way to do this?
source
share